假设我有一个名为“abc
”的跟踪分支,它跟踪 origin/master
。
当我在 'abc
' 上执行 git push
时,它会将 'abc
' 推送到 'abc
'.
如何仅使用“git push
”为其指定远程推送分支?
最佳答案
git branch --set-upstream-to abc origin/master
应该可以指定远程分支。
注意 -to
added to --set-upstream
since git1.8.0 .
自 Git1.7.0 :
"
git branch --set-upstream
" can be used to update the (surprise!) upstream, i.e. where the branch is supposed topull
andmerge
from (orrebase onto
).
关于混帐 : how to specify a default remote push-to branch?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3599412/