git在clone一个私有的工程后,第一次需要输入用户名密码,之后 push pull都不需要输入用户名密码,它的权限验证放哪儿??
os: OS X 10.8.4
git: 1.7.12.4 (Apple Git-37)
os: OS X 10.8.4
git: 1.7.12.4 (Apple Git-37)
1
turing Sep 3, 2013
|
2
zhttty Sep 3, 2013
https倒是没研究过,不过严重推荐使用ssh git的原生协议方式,密码存在~/.ssh目录文件下,一个私钥,一个公钥。
|
3
ayanamist Sep 3, 2013
应该是放在~/.netrc里? https://gist.github.com/technoweenie/1072829 https://code.google.com/p/support/wiki/GitFAQ#I_put_my_credentials_in_.netrc_,_so_why_does_git_still_ask_me_fo
@zhttty 现在GitHub对只读权限默认走https |
4
clydelin OP @ayanamist
@zhttty 我现在用 http://git.oschina.net/ 也就是 gitlab了。 ~/.ssh 下没有公钥 私钥, ~/.netrc下也没有相关文件 我现在就很疑惑 为什么不用输入密码 |
6
msg7086 Sep 3, 2013
你连接的时候是用https还是git@
|
9
kfll Sep 3, 2013
看源码吧
https://github.com/git/git/blob/master/credential.c 或者 man git-credential 如果要保存到本地,看 git-credential-store 和 git-credential-cache,对应的源码看名字就能找到了。 如果要看调用的地方,看 https://github.com/git/git/blob/master/http.c |
10
PHILO10 Oct 3, 2014
我估计你要的是这个:
git config --global credential.helper store 你输入一次之后就会被记录账号密码以后就不用账号密码就能提交代码了 |