- 在github上配置ssh
- 使用以下命令:
git config --global url."git@github.com:".insteadOf "(https://github.com/)"
??注意:這個設置會導致Swift Package Manager拉取不到配置,所以需反向替換一次
- 使用反向替換命令:
git config --global url."https://github.com/apple".insteadOf "(git@github.com:apple)"
最后.gitconfig文件中包含以下兩條,即設置完成
[url "git@github.com:"]
insteadOf = (https://github.com/)
[url "https://github.com/apple"]
insteadOf = (git@github.com:apple)