git 笔记
-
clone github 项目速度慢问题 github需要科学上网才能全速。 仅仅是系统使用代理是不够的,git需要另外使用命令才能开启代理(即使系统已开启全局代理模式)
使用以下命令开启代理:
//全局代理
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
//局部代理
git config --local http.proxy http://127.0.0.1:1080
git config --local https.proxy https://127.0.0.1:1080
#只对github.com
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080
取消代理:
//全局代理
git config --global --unset http.proxy
git config --global --unset https.proxy
//局部代理
git config --local --unset http.proxy
git config --local --unset https.proxy
#取消代理
git config --global --unset http.https://github.com.proxy
-
idea 的“Git Pull Failed: Authentication failed”问题
因为之前设置了代理,公司如果做了限制,就会出权限错误问题,这时需要取消代理。
下载github代码需要使用代理时,可以使用局部代理。
-
本地保存帐号密码
使用https时每次都需要用户名密码,很麻烦。
git bash 进入你的项目目录,输入:
git config --global credential.helper store