设置git默认配置 :return:
()
| 23 | """工具拉取管理类""" |
| 24 | @staticmethod |
| 25 | def set_default_config(): |
| 26 | """ |
| 27 | 设置git默认配置 |
| 28 | :return: |
| 29 | """ |
| 30 | try: |
| 31 | # 设置git config --global core.longpaths true |
| 32 | # 防止在Windows下出现由于绝对路径过长(超出260字符)导致拉取失败的情况 |
| 33 | # logger.info("设置git config --global core.longpaths true,预防git拉代码文件全路径过长错误。") |
| 34 | subprocess.check_call(["git", "config", "--global", "core.longpaths", "true"]) |
| 35 | |
| 36 | # 解决git命令行操作时中文文件名乱码 |
| 37 | # logger.info("设置git config --global core.quotepath off,解决git命令行操作时中文文件名乱码。") |
| 38 | subprocess.check_call(["git", "config", "--global", "core.quotepath", "off"]) |
| 39 | except Exception as err: |
| 40 | logger.warning(f"set git config encounter error: {str(err)}") |
| 41 | |
| 42 | @staticmethod |
| 43 | def set_blame_ignore(): |