我搜索了一些 退出并找到了一些类似的主题,但没有解决方案适合我
我在 Bitbucket 上有一些存储库,一些是私有的,一些是在团队中的。我创建了一个新的存储库 (webroot),一个团队 (nskiv) 作为所有者。我添加了这个本地git remote add origin git@bitbucket.org:nskiv/webroot.git
我添加了一些文件并将它们推送到存储库。然后我连接到我的服务器,当我尝试拉我时,我经常需要输入我的密码。当我这样做时,它工作正常,但很烦人,也没有必要。
奇怪的是,我在任何地方都没有使用 HTTPS 链接。我的本地.git/config看起来像这样:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = git@bitbucket.org:nskiv/webroot.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
Run Code Online (Sandbox Code Playgroud)
在我的服务器上,我使用我的用户名 (maurice) 登录并将cat /home/maurice/.ssh/id_rsa.pub | pbcopy我的密钥复制 ( ) 到团队的 SSH 密钥设置。
当我尝试克隆 repo ( git clone git@bitbucket.org:nskiv/webroot.git) 时,我必须输入我的密码。但为什么?
编辑:
解决方案是使用 eval 激活 ssh 代理"$(ssh-agent -s)"第一步我忘记配置我的服务器
| 归档时间: |
|
| 查看次数: |
2733 次 |
| 最近记录: |