Chen Di's Blog

Easy Guide to Git Proxy Setup


command to set proxy for git

git config --global http.proxy http://127.0.0.1:7897
git config --global https.proxy https://127.0.0.1:7897

modify .gitconfig file

vim ~/.gitconfig

[http]
        version = HTTP/1.1
        proxy = http://127.0.0.1:7890 # your proxy
[core]
        excludesfile = /Users/kevin/.gitignore_global
[difftool "sourcetree"]
        cmd = opendiff \"$LOCAL\" \"$REMOTE\"
        path =
[mergetool "sourcetree"]
        cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
        trustExitCode = true
[user]
        name = Jemmy
        email = [email protected]
[https]
        proxy = https://127.0.0.1:7890 # your proxy