解决mac下Sourcetree每次拉取代码都需要输入密码

解决方法

1.先使用命令下载 git-credential-osxkeychain 

 curl http://github-media-downloads.s3.amazonaws.com/osx/git-credential-osxkeychain -o git-credential-osxkeychain

2.把 git-credential-osxkeychain 放入 bin目录  

mv git-credential-osxkeychain /usr/local/bin

3.给 git-credential-osxkeychain 赋权限  

chmod u+x /usr/local/bin/git-credential-osxkeychain

4.在Git全局配置中进行设置(也可以在某一个项目里面设置): 

git config --global credential.helper osxkeychain

经过上面的设置,下次访问https的项目时只需要输入一次密码,就会存储到osx的钥匙串中了,以后再也不会在Git中询问了。

猜你喜欢

转载自blog.csdn.net/wywinstonwy/article/details/109307267#comments_22040225