Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
运行时合并冲突';git rebase';_Git - Fatal编程技术网

运行时合并冲突';git rebase';

运行时合并冲突';git rebase';,git,Git,我在一个开发者分支上,我尝试执行git-rebase-remote/a\u-remote\u分支 我明白了: 我的问题是为什么git-rebase试图应用“更改1” 这是因为当我做git log时,我在我的本地分支中看到了“change#1”,为什么git在我重新设置基础时再次尝试应用“change#1”?合并和rebase之间的区别在于rebase试图使您的分支看起来像是基于父分支的更新版本。因此,它将删除所有分支提交,快进到最新的父提交,然后尝试重新应用更改。因此,重新定位。如果您merge

我在一个开发者分支上,我尝试执行
git-rebase-remote/a\u-remote\u分支
我明白了:

我的问题是为什么
git-rebase
试图应用“更改1”


这是因为当我做
git log
时,我在我的本地分支中看到了“change#1”,为什么git在我重新设置基础时再次尝试应用“change#1”?

合并
rebase
之间的区别在于
rebase
试图使您的分支看起来像是基于父分支的更新版本。因此,它将删除所有分支提交,快进到最新的父提交,然后尝试重新应用更改。因此,重新定位。如果您
merge
,它将进行一次新的提交,在您的工作之上引入所有父级更改。那么冲突(如果有的话)将出现在合并提交中,而不是在您现有的分支工作中。

合并
和重新基址之间的区别在于,
重新基址
试图使您的分支看起来像是基于父分支的更新版本。因此,它将删除所有分支提交,快进到最新的父提交,然后尝试重新应用更改。因此,重新定位。如果您
merge
,它将进行一次新的提交,在您的工作之上引入所有父级更改。那么冲突(如果有的话)将出现在合并提交中,而不是在您现有的分支工作中。

如果我签出这样的远程分支“git check-b aBranch remote/aBranch”,我将跟踪“remote/aBranch”,对吗?我的问题是,如果有人“rebase remote/aBranch”,我能从“git log”中分辨出来吗?@michael:对于其他人可以看到的分支,rebase是不合适的。它重写了历史,这会给在同一棵树上工作的其他人带来灾难。当您的项目最终以补丁集的形式提交回来时(然后分支将失效),而不是当您能够直接
git push
时,重定基址非常有用。如果我签出这样一个远程分支“git check-b aBranch remote/aBranch”,我正在跟踪“remote/aBranch”,对吗?我的问题是,如果有人“rebase remote/aBranch”,我能从“git log”中分辨出来吗?@michael:对于其他人可以看到的分支,rebase是不合适的。它重写了历史,这会给在同一棵树上工作的其他人带来灾难。当您的项目最终将作为补丁集提交回来时(然后分支将失效),而不是当您能够直接
git push
时,重定基址非常有用。
First, rewinding head to replay your work on top of it...
Applying: change #1
Failed to merge in the changes.
Patch failed at 0001 change #1