git pull导致冲突但是git pull --rebase不是这意味着什么? [英] What does it mean when git pull causes a conflict but git pull --rebase doesn't?

查看:1418
本文介绍了git pull导致冲突但是git pull --rebase不是这意味着什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从只能访问的存储库中提取数据。据我所知,我只从一个存储库推送到它。有几次,我试着推进它,并得到这个:

I'm pulling from a repository that only I have access to. As far as I know, I've only pushed to it from one repository. A couple of times, I've tried pushing to it and gotten this:

To jbaker@192.168.2.216:tsched_dev.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'jbaker@192.168.2.216:tsched_dev.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.  See the 'Note about
fast-forwards' section of 'git push --help' for details.

通常,这意味着我必须执行 git pull (尽管所有更改应该可快速转发)。当我做一个 git pull 时,我会发生冲突。如果我做一个 git pull --rebase ,它可以正常工作。我做错了什么?

Generally, that just means that I have to do a git pull (although all the changes should be fast-forwardable). When I do a git pull, I get conflicts. If I do a git pull --rebase, it works fine. What am I doing wrong?

推荐答案

这意味着当前的原点/主点和当前的主点(与您自己的提交)不兼容,但是如果自上次更新以来发生了更改并将它们放在自己的提交之前,则会导致非冲突状态。

It means that current origin/master and current master(with your own commits) are not compatible, but that if you got the changes since the last update and put them before your own commits it leads to a non-conflicting state.

基本上,这取决于您如何订购提交你有冲突。有了rebase,你可以把原始的东西放在你的前面,合并你把原始的东西放在你的主人身上,这样做可以有所作为。

Basically that depends how you order the commits you have conflicts. With a rebase you put the origin ones before yours, with merge you put the origin ones as a whole against your master, that can make a difference.

这篇关于git pull导致冲突但是git pull --rebase不是这意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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