社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Git

带有默认参数的git rebase不会检测到冲突。为什么?

Tomasz Cyborowski • 5 年前 • 1462 次点击  

我有这样一个场景:

简单的c项目,包含一些文件:fun1.cs、fun2.cs、fun3.cs。 文件包含空类。

我有两个分支:

  • 删除fun3.cs文件的branchone
  • 修改fun3.cs文件的分支。

我将brachone合并为master,现在我尝试branchtwo执行: Git Rebase主机

我本来希望得到confict-fun3.cs已经被删除-但是没有冲突,fun3.cs中的更改被应用到fun1.cs(!)

Git Rebase和其他选项,如:

git rebase -i master
git rebase master -m
git rebase master -s recursive
git rebase master -s recursive -X rename-threshold=100
git rebase master -s recursive -Xpatience

全部检测确认。

控制台输出:

/GitCondingDojo/Example/MyProject (branchtwo)
$ git rebase master -m
First, rewinding head to replay your work on top of it...
CONFLICT (modify/delete): MyGitApp/Fun3.cs deleted in master and modified in HEAD~0. Version HEAD~0 of MyGitApp/Fun3.cs left in tree.

Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".


/GitCondingDojo/Example/MyProject (branchtwo|REBASE-m 1/1)
$ git rebase --abort

/GitCondingDojo/Example/MyProject (branchtwo)
$ git rebase master -s recursive
First, rewinding head to replay your work on top of it...
CONFLICT (modify/delete): MyGitApp/Fun3.cs deleted in master and modified in HEAD~0. Version HEAD~0 of MyGitApp/Fun3.cs left in tree.

Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".


/GitCondingDojo/Example/MyProject (branchtwo|REBASE-m 1/1)
$ git rebase --abort

/GitCondingDojo/Example/MyProject (branchtwo)
$ git rebase master
First, rewinding head to replay your work on top of it...
Applying: added functionality to Fun3
Using index info to reconstruct a base tree...
A       MyGitApp/Fun3.cs
Falling back to patching base and 3-way merge...
Auto-merging MyGitApp/Fun1.cs

这种行为背后的理由是什么?是否有一组“安全”或“推荐”的参数用于重新定位?

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/40905
 
1462 次点击  
文章 [ 2 ]  |  最新文章 5 年前
Prasheel
Reply   •   1 楼
Prasheel    6 年前

试着做一个 git fetch origin 之前 git rebase master . 这应该能达到目的。

max630
Reply   •   2 楼
max630    6 年前

这是重命名检测检测检测错误的重命名。尝试添加 -Xno-renames REBASE命令的选项

是否有一组“安全”或“推荐”的参数用于重新定位?

恐怕没有一套普遍匹配的光学元件。像您这样的“无冲突”端的案例比“冲突”端的案例更为罕见,因此通常会检测到它,然后您可以使用其他选项重试。万一像你这样的人没注意到,你以后就得修了。希望信息不会丢失,您可以稍后将其移动到正确的位置。