簡體   English   中英

第一次提交到git存儲庫時出現問題

[英]Trouble with first commit to git repository

我是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'

我怎樣才能清理它並獲得正確的遙控器?

您只需要刪除具有錯誤引用的origin遠程:

$ git remote rm origin

然后重新啟動添加,然后推送,你應該很高興。

$ git remote add origin git@github.com:christineh/Hello-World.git
$ git push -u origin master

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM