在我将 Ubuntu 从 14.04 升级到 14.10(现在升级到 15.04)后,我失去了使用 git 协议(protocol)连接到 GitHub 和 Bitbucket 的能力,https 和 ssh 工作正常:ssh -T git@github.com
Hi Arbolista! You've successfully authenticated, but GitHub does not provide shell access.
惊人的。git remote add github git@github.com:arbolista/my_repo.git
git remote -v
github https://github.arbolista/my_repo.git (fetch)
github https://github.arbolista/my_repo.git (push)
git pull github master
fatal: repository 'https://github.arbolista/my_repo.git/' not found
不是那么棒,让我发疯。我重新安装了 git(现在是最新的 2.5.2)和我的 ssh key 无济于事 - 我完全迷失了这一点。
我还确保 git 端口没有防火墙:sudo ufw status verbose
Status: inactive
我的 ~/.ssh/config 看起来像这样(从它工作时不变):Host github.com-arbolista
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
最佳答案
打开.git/config
.应该有一个名为 [remote "github"]
的部分与 url=https://github.arbolista/my_repo.git
更改url
至git@github.com:arbolista/my_repo.git
关于git - 升级后 Ubuntu 无法找到 Git 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32568325/