git报错

[!] Unable to add a source with url https://github.com/CocoaPods/Specs.git Failed to connect to 127.0.0.1 port 1080: Connection refused

原因git 设置了代理

使用git config --global --list命令查看是否设置了代理

➜  ~ git config --global --list
core.excludesfile=/Users/xxxxxx/.gitignore_global
difftool.sourcetree.cmd=opendiff "$LOCAL" "$REMOTE"
difftool.sourcetree.path=
mergetool.sourcetree.cmd=/Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh "$LOCAL" "$REMOTE" -ancestor "$BASE" -merge "$MERGED"
mergetool.sourcetree.trustexitcode=true
http.proxy=socks5://127.0.0.1:1086
https.proxy=socks5://127.0.0.1:1086
user.name=xxxxxxxx
[email protected]

还原:

git config --global --unset http.https://github.com.proxy
git config --global --unset https.https://github.com.proxy

你可能感兴趣的:(git报错)