我刚买了一台新机器,我正在开发一个新的 github 存储库。我使用
将它克隆到我的机器中git clone git@github.com:<username>/<exact-repo-name>.git
它克隆得很好:
Cloning into '<exact-repo-name>'...
remote: Counting objects: ###, done.
remote: Total ### (delta 0), reused 0 (delta 0), pack-reused ###
Receiving objects: 100% (###/###), ### KiB | 0 bytes/s, done.
Resolving deltas: 100% (###/###), done.
Checking connectivity... done.
并且,我通过执行以下操作在本地添加所有远程分支:
在 git branch -r 中用于远程;做 git checkout -b $remote;完成
然后,当我尝试从任何分支中 pull 出时,使用
git pull origin/<branch-name>
我遇到了一个非常常见的错误:
origin/<branch-name> does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
所以,我完成了所有步骤:
ssh -vT git@github.com
ssh-add -l
eval "$(ssh-agent -s)"
这些都成功了,我检查了 ssh-add -l
的输出,我看到它在我的 github 帐户的 ssh key 列表中。我进入设置 -> ssh key ,我在那里看到了代理。
ssh
是否有特定的用户权限?
最佳答案
我同意@Felix 的观点,这很可能不是 SSH 问题,尽管它可能伪装成这个问题。相反,我认为你的路径有问题。您可以尝试像这样运行 git clone
:
git clone https://username@github.com/username/exact-repo-name.git
这里的 username
是你的 GitHub 用户名。 Git 将提示您输入密码,因此您不必以纯文本形式输入密码。请阅读this SO article获取更多信息。
关于linux - `ssh -vT git@github.com` 工作正常,代理在 github ssh key 中。问题在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32163649/