Proper way to avoid asking for password on every pull on production server

牧云@^-^@ 提交于 2019-12-13 21:51:42

问题


I cloned repository from bitbucket but with my username like

git pull username@repository.blah

now it asks me for my bitbucket password every time. Now other developers want to pull too, but what should I do to make it easy for every developer.


回答1:


You should use SSH (not HTTPS):

git clone git@bitbucket.org:<your-usert>/<your-repo>.git

Create ssh key files using ssh-keygen utility (all questions you may answer yes). Add a public key content to User->Butbucket settings->SSH keys.

Now you can use any git command without enter your password




回答2:


You can use git config --global credential.helper manager. So you need to input your username and password for the first time, then it will not ask for password next time.



来源:https://stackoverflow.com/questions/40630810/proper-way-to-avoid-asking-for-password-on-every-pull-on-production-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!