[英]Pushing repo to remote repository (GitHub)
我是Git / GitHub的新手。 嘗試將文件推送到新的存儲庫中,但該文件無法正常工作。 這是我的過程:
git remote add origiN <URL>
git remote -v
這一切似乎都按計划進行,隨着航站樓的返回
origiN <URL> (fetch)
origiN <URL> (push)
...符合預期
然后,當我運行git push
,我得到:
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using
git remote add <name> <url>
and then push using the remote name
git push <name>
...但是我以為我已經配置了遠程存儲庫?
我想念什么?
git push -u origin master
那你就可以git push
我輸入時,psydroyd回答了,但這里有一些詳細信息:
一個存儲庫可以有多個遠程服務器。 您可以通過運行以下命令顯式推送到遠程服務器:
git push <remote> <branch>
但是,如果您想讓git push
在不使用任何其他參數的情況下工作,則可以使用--set-upstream
選項aka -u
,如下所示:
git push -u origin master
這將設置您的本地分支以跟蹤遠程master
分支。 之后,您可以運行:
git push
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.