You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Git rebase后文件A内容移入B,撤销变基问题仍存求助

问题详情

环境信息

  • 本地机器:Linux 16.1
  • 协作成员环境:Visual Studio 2022(Win11)

提交与操作过程

今天将团队成员修改了file B的PR合并至master分支,合并后master分支提交图谱(简化版)如下:

* 4c0ffef (master) Squash and merge feature-backpack
| * cdf5f1d (feature-output) Modified file A
| | * 8221882 (feature-backpack) Modified part of file B
| | * 491d131 Modified part of file B
| |/  
|/|   
* | c196bda Merge "Delete file C" (feature-output) into master
|\| 
| * 24a0b99 Deleted file C
| * a8784c7
|/
* bcd8844

之后在feature-output分支执行git rebase origin/master以同步最新PR变更,却触发冲突:file A的部分内容被移入file B并显示为冲突,file A仍存在但对应内容已缺失。

执行git rebase --abort后,发现file A的该部分内容已永久移入file B,且Git将其标记为修改。

疑问与补充

  • 疑问:这是否是因为删除file C导致Git误将A、B判定为重命名?注:A、B在file C删除前已存在。
  • 补充:此前曾使用dos2unix统一换行符。

内容的提问来源于stack exchange,提问作者Autopy

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 09:22:35