适当的方式避免在生产服务器上每次拉扯要求密码 [英] Proper way to avoid asking for password on every pull on production server
问题描述
我从bitbucket中克隆了存储库,但是使用我的用户名,如
I cloned repository from bitbucket but with my username like
git pull username@repository.blah
git pull username@repository.blah
现在它每次都要求我的bitbucket密码。现在其他开发人员也想拉,但是我应该怎么做,让每个开发人员都能轻松一点。
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.
推荐答案
你应该使用SSH (不是HTTPS):
You should use SSH (not HTTPS):
git clone git@bitbucket.org:<your-usert>/<your-repo>.git
使用 ssh-keygen创建ssh密钥文件
实用程序(您可以回答的所有问题是
)。添加公钥内容到User-> Butbucket设置 - > SSH密钥。
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.
现在,您可以使用任何git命令,无需输入密码
Now you can use any git command without enter your password
这篇关于适当的方式避免在生产服务器上每次拉扯要求密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!