原文鏈接:https://blog.csdn.net/tian_ci/article/details/93397137
問題
進(jìn)行g(shù)it push操作時(shí)報(bào)錯(cuò):fatal: The current branch master has no upstream branch.

**原因:**沒有將本地的分支與遠(yuǎn)程倉庫的分支進(jìn)行關(guān)聯(lián)
通過git branch查看本地分支只有master

通過git branch -a查看遠(yuǎn)程分支,有master和remotes/origin/master兩個(gè)

這時(shí)由于遠(yuǎn)程倉庫太多,且分支較多。在默認(rèn)情況下,git push時(shí)一般會上傳到origin下的master分支上,然而當(dāng)repository和branch過多,而又沒有設(shè)置關(guān)聯(lián)時(shí),git就會產(chǎn)生疑問,因?yàn)樗鼰o法判斷你的push目標(biāo)
使用git push --set-upstream origin master命令
使用git push -u origin master命令