報錯信息
- 示例代碼:
feature/file
是分支名
fatal: The current branch feature/file has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin feature/file
- 中文釋義:
推送錯誤:當(dāng)前分支特性/文件沒有上游分支。
要推動當(dāng)前分支并將遠(yuǎn)端設(shè)置為上游,請使用 :
git push --set-upstream origin feature/file
在于當(dāng)前這個分支沒有和任何的倉庫發(fā)生關(guān)聯(lián),origin是倉庫的一個指針,需要將當(dāng)前的分支與這個指針之間形成關(guān)聯(lián)。文章來源:http://www.zghlxwxcb.cn/news/detail-505276.html
解決方法
- 直接允許以下命令即可
git push --set-upstream origin feature/file
執(zhí)行之后會在github
上自動新建一個 feature/file
的分支。文章來源地址http://www.zghlxwxcb.cn/news/detail-505276.html
到了這里,關(guān)于【Git】push分支報錯:fatal: The current branch 當(dāng)前分支名 has no upstream branch的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!