有了Git,我怎么能拉,但不会导致合并? [英] With Git, how can I pull, but without causing a merge?

查看:171
本文介绍了有了Git,我怎么能拉,但不会导致合并?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个新的提交,但在此之前忘了提交。 (我应该使用 git stash 并且比 git pull 。)现在,如果我 git pull ,我得到了一个额外的提交merge origin /< branch> to< branch>(一些提交已经被其他一些同事推送了),我不想这样做。 p>

有没有办法在不合并的情况下执行 git pull

git pull 本质上是 git fetch ,然后是 git merge ,所以如果你想在没有合并的情况下进行pull操作,只需执行 git fetch


I have created a new commit, but forgot to pull before that. (I should have used git stashand than git pull.) Now if I git pull, I get an additional commit "merge origin/<branch> to <branch>" (Some commits have already been pushed by some other colleagues.), which I don't want.

Is there any way to do git pull without merging?

解决方案

git pull is essentially git fetch followed by git merge, so if you want a pull without the merge, just do git fetch.

这篇关于有了Git,我怎么能拉,但不会导致合并?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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