Git错误:找不到存储库

时间:2018-07-01 14:17:11

标签: git forge

我一直在阅读其他Git存储库,但未发现错误,但仍在努力解决我遇到的问题。

我正在开发一个本地存储库,将其推送到Forge监视的Remote,并在更新master分支时将其部署到生产环境中。它没有部署我要推动的更改!我做出了4项在网站上尚未实现的贡献。我也尝试过通过“立即部署”按钮从Forge内部手动部署代码,但这也不起作用。我收到的错误已附在下面。

Fri Jun 29 08:30:42 UTC 2018
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我是GitHub项目的贡献者。我已将SSH密钥添加到我的github帐户以及Forge管理区域中,以便可以通过SSH进入Forge服务器。

当我在Forge服务器上运行ssh -T git@github.com时,我得到了另一个不再从事该项目的工程师的名字。因此,我认为问题出在Forge服务器上,因为它没有我的钥匙。所以我尝试了:

ssh-copy-id forge@[ip address] I get the following:

INFO: attempting to log in with the new key(s), to filter out any that 
are already installed

/usr/bin/ssh-copy-id: WARNING: All keys were skipped because they 
already exist on the remote system.

(if you think this is a mistake, you may want to use -f option)

我应该强迫吗?

这是我的.ssh / config

Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa

[edit]因此,运行ssh -vvv git@github.com会得出:

debug1: Authenticating to github.com:22 as 'git'
debug3: hostkeys_foreach: reading file "/home/forge/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file 
/home/forge/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys from github.com

2 个答案:

答案 0 :(得分:0)

  

当我在Forge服务器上运行ssh -T git@github.com时,我得到了另一个不再从事该项目的工程师的名字。因此,我认为问题出在Forge服务器上,因为它没有我的钥匙。

是正确的,但是有些不完整。更具体地说,当您在Forge服务器上并运行ssh -T git@github.com时,Forge服务器会为GitHub提供 some 密钥。密钥确实存在,在GitHub上的Forge服务器中都存在。 GitHub会使用该密钥(无论它是什么)来找出您的身份,并且GitHub上存储的内容表明该 密钥属于另一位工程师。

  

... ssh-copy-id forge@[ip address]

大概是从具有 GitHub密钥的计算机上运行此代码。如果是这样,那是适当的。

  

[产生]

/usr/bin/ssh-copy-id: WARNING: All keys were skipped because they 
already exist on the remote system.

(if you think this is a mistake, you may want to use -f option)

您确实可以使用-f

我自己以不同的方式完成所有操作:我有一个ssh密钥,仅用于GitHub访问,并因此配置了要访问GitHub的系统:

$ cat $HOME/.ssh/config
[snip]
Host github.com
        IdentityFile ~/.ssh/id.github
        IdentitiesOnly yes

(其中id.github包含私钥,id.github.pub包含公钥)。

我为每个组织使用不同的密钥对,这可以生成复杂的.ssh/config文件,但是这意味着我没有将所有内容都分发给所有人。

答案 1 :(得分:0)

下面我修复Forge通过SSH连接到GitHub的步骤如下:

  1. Github Generate SSH Key
  2. Add SSH Key to SSH-agent
  3. Add new ssh key to git hub account

    ssh-keygen -t rsa -b 4096 -C“我的电子邮件”

    评估“ $(ssh-agent -s)”

    ssh-add〜/ .ssh / id_rsa

    ssh -vT git@github.com

    [不包括技术消耗] 嗨[我的用户名]!您已经成功通过身份验证,但是GitHub没有 提供外壳访问。

cat〜/ .ssh / id_rsa.pub-通过转到设置> SSH和GPG密钥>单击新建SSH密钥或添加SSH密钥,将其复制并添加到github帐户中。