一些有用的 Git 环境变量
Jan 12, 2017
GIT_CURL_VERBOSE
用来给出 curl 的输出, 效果等同于 curl -v
➜ Repo git:(master) GIT_CURL_VERBOSE=1 git pull
* Couldn't find host github.com in the .netrc file; using defaults
* Trying 192.30.253.112...
* TCP_NODELAY set
* Connection failed
* connect to 192.30.253.112 port 443 failed: Operation timed out
* Trying 192.30.253.113...
* TCP_NODELAY set
* Connection failed
* connect to 192.30.253.113 port 443 failed: Operation timed out
* Failed to connect to github.com port 443: Operation timed out
* Closing connection 0
GIT_SSL_NO_VERIFY
用来跳过 SSL 证书验证.
➜ Repo git:(master) GIT_SSL_NO_VERIFY=true git pull
已经是最新的。 // 并没有什么改变(
GIT_HTTP_USER_AGENT
用来更改 Git 的 UA, 默认为 git/版本号, 例如 git/2.11.0
➜ Repo git:(master) GIT_HTTP_USER_AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36" git pull
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.