使用 defaults write com.apple.dt.Xcode IDEPackageSupportUseBuiltinSCM YES
命令,可以全局切换内置 git
。
- 切换内置默认
git
bash
defaults write com.apple.dt.Xcode IDEPackageSupportUseBuiltinSCM YES
defaults write com.apple.dt.Xcode IDEPackageSupportUseBuiltinSCM YES
- 设置代理
如果使用 clash
的话,{yourprox}
默认为 socks5://127.0.0.1:7890
或者 http://127.0.0.1:7890
,请根据自己实际使用的代理软件进行调整。 --global
为全局设置,如果只设置当前项目,可移除 --global
bash
# 设置所有
git config --global http.proxy {yourproxy} && git config --global https.proxy {yourproxy}
# 单独给 Github 配置代理
git config --global http.https://github.com.proxy {yourproxy} && git config --global https.https://github.com.proxy {yourproxy}
# 设置所有
git config --global http.proxy {yourproxy} && git config --global https.proxy {yourproxy}
# 单独给 Github 配置代理
git config --global http.https://github.com.proxy {yourproxy} && git config --global https.https://github.com.proxy {yourproxy}
- 查看刚刚的设置
bash
git config --list --global
git config --list --global
- 恢复默认
bash
defaults write com.apple.dt.Xcode IDEPackageSupportUseBuiltinSCM NO
# 若第二步中设置所有,则使用以下命令进行还原
git config --global --unset http.proxy && git config --global --unset https.proxy
# 若第二步中单独设置 Github,则使用以下命令进行还原
git config --global --unset http.https://github.com.proxy && git co
defaults write com.apple.dt.Xcode IDEPackageSupportUseBuiltinSCM NO
# 若第二步中设置所有,则使用以下命令进行还原
git config --global --unset http.proxy && git config --global --unset https.proxy
# 若第二步中单独设置 Github,则使用以下命令进行还原
git config --global --unset http.https://github.com.proxy && git co
参考链接 https://podul.dev/posts/resolving-slow-download-issue-of-spm-packages-in-xcode/