如果我创建了一个新的分支并尝试推送它,系统会告诉我必须明确指定上游分支的名称。
> 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>
的方式,无论当前分支名称是什么都可以使用?
git push --set-upstream <current_branch_name>
。 - Good Night Nerd Pride