Equivalent of branch.<name>.merge for git-push

陌路散爱 提交于 2019-12-11 02:07:57

问题


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 (see push.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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!