我已经在 SO 上搜索并阅读了大多数类似的问题,但似乎没有一个与我的相同。我在 Github 上有一个私人仓库,一个小时前我可以很好地推送。现在,我收到 ERROR: Repository not found 消息。
我的 ~/.ssh/config 中有以下内容:
Host github
Hostname github.com
User git
IdentityFile ~/.ssh/id_rsa_gr.pub
因为我需要使用特定的公钥。我的 .git/config 如下所示(出于安全目的,进行了一些信息更改:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github:MyProject/MyProject.git
[branch "master"]
remote = origin
merge = refs/heads/master
我不明白为什么它工作了一段时间然后就停止了。
编辑:现在,我什至无法克隆它。我犯了同样的错误。
编辑 2:我将 VERBOSE 添加到我的 ssh 配置中,这就是我得到的:
Authenticated to github.com ([207.97.227.239]:22).
ERROR: Repository not found.
Transferred: sent 2432, received 2920 bytes, in 0.2 seconds
Bytes per second: sent 12278.1, received 14741.7
fatal: The remote end hung up unexpectedly
编辑3:更多信息,我跑了 ssh -vT git@github ,这里是相关信息:
debug1: Reading configuration data /Users/gdboling/.ssh/config
debug1: Applying options for gh
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug1: Connecting to github.com [207.97.227.239] port 22.
debug1: Connection established.
debug1: identity file /Users/gdboling/.ssh/id_rsa_gr type 1
debug1: identity file /Users/gdboling/.ssh/id_rsa_gr-cert type -1
....
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/gdboling/.ssh/id_rsa
请注意,它正在找到正确的密钥,然后使用错误的密钥。