有一个相关的SO问题,涉及如何更改push
命令的参数以避免此错误消息:
fatal: The upstream branch of your current branch does not match the name of your current branch
我想知道如何消除这个消息本身,而不需要更改我的本地/远程分支名称或使用花哨的push
命令。
假设我有一个跟踪不同名称的远程分支的本地分支:
user@home:~ git branch -vv
branch-name abcd1234 [remote/origin/branch-name] last commit message
现在我希望只需输入
git push
即可推送我的提交更改。当我这样做时,我会收到以下消息:
fatal: The upstream branch of your current branch does not match the name of your current branch. To push to the upstream branch on the remote, use git push origin HEAD:remote/origin/branch-name To push to the branch of the same name on the remote, use git push origin branch-name
我如何强制git
自动将代码推送到上游分支,即使名称不匹配? 我正在使用git 1.9.1
git push
,但是收到了相同的消息。 - quant