Add this script to ~/.bash_profile or Execute Once (If close terminal,the proxy settings will be clear).
export all_proxy=socks5://127.0.0.1:1086
vim ~/.zshrc
# proxy list
alias proxy='export all_proxy=socks5://127.0.0.1:1086'
alias unproxy='unset all_proxy'
proxy
unproxy
git config --global http.proxy 'socks5://127.0.0.1:1086'
git config --global https.proxy 'socks5://127.0.0.1:1086'