等价的分支。< name> .merge for git-push [英] Equivalent of branch.<name>.merge for git-push

查看:229
本文介绍了等价的分支。< name> .merge for git-push的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 git-config 文档分支。< name> .merge


分支。< name> .merge



定义< c>分支。< name> .remote ,给定分支的
上游分支。它告诉 git fetch / git pull / git
rebase
要合并的分支并且也可以影响 git push (见
push.default )。


有一个等价的设置来指定上游分支推送到给定的分支?这是我想实现的行为 - 比如说我有一个分支 A ,并且 remote 设置为来源。从分支 A 运行 git push ,结果应该等同于运行 git push refs / heads / A:refs / for / master



另外,是否存在 remote。*的值。推动这将实现这种行为?将 remote.origin.push 设置为 refs / heads / *:refs / for / master 导致无效的refspec。

解决方案

我认为这篇文章可能会有帮助: HEAD的git别名:refs / for / master

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.

解决方案

I think that this post may be helpful: git alias for HEAD:refs/for/master

这篇关于等价的分支。&lt; name&gt; .merge for git-push的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆