问题
According to the git-config
documentation for branch.<name>.merge
:
branch.<name>.merge
Defines, together with
branch.<name>.remote
, the upstream branch for the given branch. It tells git fetch/git pull/git rebase which branch to merge and can also affect git push (seepush.default
).
Is there an equivalent setting to specify the upstream branch to push to, for the given branch? This is the behaviour I want to achieve - say I have a branch A
with remote
set to origin
. On running git push
from branch A
, the result should be equivalent to running git push refs/heads/A:refs/for/master
.
Alternatively, is there a value of remote.*.push
which will achieve this behaviour? Setting remote.origin.push
to refs/heads/*:refs/for/master
resulted in an invalid refspec.
回答1:
I think that this post may be helpful: git alias for HEAD:refs/for/master
来源:https://stackoverflow.com/questions/29664305/equivalent-of-branch-name-merge-for-git-push