5

我是 Git 新手,并且已经设置并创建了我的第一个存储库。我正在尝试添加一个 README 作为第一个提交,并且我一直在按照http://help.github.com/create-a-repo/上的步骤进行操作,但我在这一步上遇到了困难:

git push -u origin master

我收到此错误:

ERROR: username/Hello-World.git doesn't exist. Did you enter it correctly?

我认为这是因为我的git remote add命令错误:我忘记替换我的用户名和存储库名称。用正确的参数重试它会给我:

$ git remote add origin git@github.com:christineh/Hello-World.git
 fatal: remote origin already exists.
$ git push -u origin master
Enter passphrase for key '/Users/christinehorvat/.ssh/id_rsa':
 ERROR: username/Hello-World.git doesn't exist. Did you enter it correctly?
 fatal: The remote end hung up unexpectedly'

我怎样才能清理它并获得正确的遥控器?

4

1 回答 1

15

您只需删除origin具有不正确引用的遥控器:

$ git remote rm origin

然后重新启动添加,然后推送,你应该很高兴。

$ git remote add origin git@github.com:christineh/Hello-World.git
$ git push -u origin master
于 2011-12-04T20:48:18.660 回答