如果我創建了一個新分支並嘗試推送它,我被告知必須明確說明上游分支的名稱應該是什麼。如何設置上游分支與分支的名稱相同
> git checkout -b feature/long-branch-name-I-dont-want-to-have-to-type-out
Switched to a new branch 'feature/long-branch-name-I-dont-want-to-have-to-type-out'
> git push
fatal: The current branch feature/long-branch-name-I-dont-want-to-have-to-type-out has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin feature/long-branch-name-I-dont-want-to-have-to-type-out
有沒有辦法做到這一點,而不必輸入上游分支的名稱?我實際上總是希望它在服務器上與本地名稱相同。
有什麼辦法可以做到像git push --set-upstream <current_branch_name>
這樣的東西,而不管當前分支名稱是什麼?