1. 程式人生 > >git push時報錯Git master branch has no upstream branch

git push時報錯Git master branch has no upstream branch

git push時報錯 Git master branch has no upstream branch

Git master branch has no upstream branch

解決方法:

(1)如果遠端倉庫上有master分支,則按提示操作

 git push --set-upstream origin master

(2)如果沒有遠端分支,則需要這樣操作

git push -u origin master

將本地的master分支推送到origin主機,同時指定origin為預設主機,後面就可以不加任何引數使用git push了。