我有一个非常奇怪的问题与git和github。当我试着推的时候,我得到:

git push -u origin master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly

我添加了遥控器:

git remote add origin git@github.com:account-name/repo-name.git

什么好主意吗?


当前回答

我也有同样的问题。我的问题是误解,我必须先在github上创建空的回购,然后再推到它。哎!包括这个给那些没意识到的人。

其他回答

转到你的项目文件夹,然后搜索。git文件夹,然后用记事本打开配置文件,检查是否有你的链接到github回购下:[remote "origin"],如果它是不同的,然后在你的github回购,然后编辑它,或在配置文件中打开一个新的回购名称

我在更新ubuntu到下一个版本后遇到了同样的错误

我刚刚删除了我的sshkey在github帐户,然后重新添加了一个sshkey到该帐户。

这对我来说很管用:

1. 的遥控器

$ git remote rm origin
$ git remote add origin git@github.com:<USER>/<REPO>.git

如果您的SSH密钥已经在另一个github代表上使用,您可以生成一个新密钥。

2. 生成新的SSH密钥

$ ssh-keygen -t rsa -b 4096 -C "web@github.com"

3.在SSH代理级别添加密钥

$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_rsa_github

4. 将新密钥添加到Github回购。

git remote rm origin
git remote add origin <remote url>

这解决了我的问题。

   git pull https://myusername:mypassword@github.com/path_to/myRepo.git