git remote merge commit导致gerrit中的虚假依赖 [英] git remote merge commit causing false dependencies in gerrit

查看:118
本文介绍了git remote merge commit导致gerrit中的虚假依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用git中的远程分支。在做任何工作之前,我先进行一次git pull以获取ToT。当我查看git日志时,发现它会自动创建带有消息的合并提交: ssh:// myserver:1111 / mybranch的合并分支'master'。然后,我做我的工作并做出我的更改。在那之后,我推动我的零钱。我们的系统已安装Gerrit进行代码审查。我的新更改以gerrit显示,并依赖于合并提交。我该如何摆脱呢?

I am working with a remote branch in git. Before doing any work, I do a git pull to get the ToT. When I look at the git log, I see that this automatically creates a merge commit with a message: "Merge branch 'master' of ssh://myserver:1111/mybranch". Then, I do my work and commit my change. After that I push my change up. Our system is setup with gerrit for code review. My new change shows up in gerrit with dependency on the merge commit. How do I get rid of this?

推荐答案

git pull 实际上如果本地分支是远程跟踪,则 git fetch git merge 。因此,如果远程分支不是可快速转发的,则git pull将创建合并提交。为避免合并提交,请使用

git pull is actually git fetch and git merge if the local branch is remote tracking. So if the remote branch is not fast-forwardable then git pull will create a merge commit. To avoid merge commits use

'git fetch'
'git rebase -p'
'git pull --rebase' 




或设置 merge .ff 在git配置中的值仅为

or set the merge.ff with value only in the git config.


从本地分支禁用远程跟踪设置 git
config --unset分支。< branch> ;.合并

这篇关于git remote merge commit导致gerrit中的虚假依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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