1

我有一个项目,我想将“官方”代码推送到一台服务器,而在另一台服务器上“测试”代码。我有两个 git 存储库位于两个完全不同的服务器中(出于我无法控制的原因)。我们将服务器称为 Server_ONE 和 Server_TWO。由于这两个项目的代码是相同的,我想从本地机器上的一个地方管理这个项目。

所以我这样做了:

#These work fine
git clone ssh://user@SERVER_TWO:my_project.git
git remote add Server1_branch user@SERVER_ONE:my_project.git

#This fails
git fetch Server1_branch master
user@SERVER_ONE's password: #I have no idea what password to enter. 
Permission denied (publickey,gssapi-with-mic,password).

我知道 Server_ONE 拒绝权限。但我不知道在哪里添加权限?

我没有使用 Github。这些都是私有存储库。

4

1 回答 1

0

实际上...我刚刚发现了解决方案!问题是我必须做

git remote add Server1_branch ssh://user@SERVER_ONE:my_project.git 

代替

git remote add Server1_branch user@SERVER_ONE:my_project.git 
于 2012-08-30T22:36:33.070 回答