git Your branch and xxx have diverged

本文提供了一套详细的步骤来解决Git中出现的分支冲突问题。通过使用`git cherry`和`git log`命令定位冲突版本,然后回退到冲突前的版本进行手动解决,最后更新本地仓库。

git Your branch and ‘origin/aaaaa_test’ have diverged

Git 冲突解决办法:

  1. 查看与哪个版本冲突
 $git cherry origin/aaaaa_test
+ xxxxx263dc756d075b3aa7afd604c3de5

  1. 可以看到与版本:xxxxx263dc756d075b3aa7afd604c3de5冲突了,找到这个版本之前的那个版本:
git  log

在这里插入图片描述
4. 回退到冲突前的版本:

git reset --hard  xxxxxc1d6cd7311b1c087666100d5b5de7555e86
  1. 解决下有冲突的文件:
git  status

看看你修改了那些东西。

  1. 重新拉取最新版本:
git pull
48138@C030116 MINGW64 /d/project/Annotation/LP_Annotation_LaneMap (feature/demo20250704) $ git status On branch feature/demo20250704 Your branch and 'origin/feature/demo20250704' have diverged, and have 169 and 1 different commits each, respectively. (use "git pull" if you want to integrate the remote branch with yours) nothing to commit, working tree clean 48138@C030116 MINGW64 /d/project/Annotation/LP_Annotation_LaneMap (feature/demo20250704) $ git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset' | * 39da602b - (tag: V4.5.0-8) fix(components): 修复提交时indexDB错误 (4 days ago) <38165> | * 3fdf9fc4 - (tag: V4.5.0-7) fix(components): 修复无法提交 (4 days ago) <38165> | * 247c80a6 - (tag: V4.5.0-6, tag: V4.5.0-5) fix(utils): 调整多边形旋转 icon 位置 (4 days ago) <徐裕程> | * 247c80a6 - (tag: V4.5.0-6, tag: V4.5.0-5) fix(utils): 调整多边形旋转 icon 位置 (4 days ago) <徐裕程> | * c89a1883 - (tag: V4.5.0-4) feat(components): 适配清洗的多边形隐藏 (4 days ago) <38165> | * f9b098f2 - (tag: V4.5.0-3) feat(components): 清洗 case 使用大华 data-mgr/finder 异步接口 (5 days ago) <徐裕程> | * f9084c04 - fix(components): 修复旋转 icon 未自适尺寸导致过大遮住元素 (5 days ago) <徐裕程> | * 9fb50fce - fix(components): 兼容清洗与泊车 (5 days ago) <38165> :...skipping... * 715bd39b - (HEAD -> feature/demo20250704) feat(components): 高度范围滑块提示 (3 days ago) <孙中明> * ec9872ec - feat(components): 降低俯仰旋转精度+可拖拽点至黑洞 (4 days ago) <孙中明> * 89afd4dc - feat(components): 界面-高度范围滑动条下方增加输入框 (4 days ago) <孙中明> * 9e0ee3c3 - feat(components): 四边形标注增加快捷键:G (5 days ago) <孙中明> * 9509ed84 - (origin/release_4.5.1, origin/master, origin/HEAD) Merge branch 'release_4.5.0' into 'master' (34 minutes ag <袁烨威> |\ | * 3c2f1aaa - (tag: V4.5.0-11, origin/release_4.5.0) fix(components): 修复非按需加载时,剩余的元素没有按照设置显隐 (3 dayso) <38165> | * 70acb100 - fix(components): 修复单点线段或线段点属性影响车道线展示 (4 days ago) <38165> | * 39da602b - (tag: V4.5.0-8) fix(components): 修复提交时indexDB错误 (4 days ago) <38165> | * 3fdf9fc4 - (tag: V4.5.0-7) fix(components): 修复无法提交 (4 days ago) <38165> | * 247c80a6 - (tag: V4.5.0-6, tag: V4.5.0-5) fix(utils): 调整多边形旋转 icon 位置 (4 days ago) <徐裕程> | * c89a1883 - (tag: V4.5.0-4) feat(components): 适配清洗的多边形隐藏 (4 days ago) <38165> | * f9b098f2 - (tag: V4.5.0-3) feat(components): 清洗 case 使用大华 data-mgr/finder 异步接口 (5 days ago) <徐裕程> | * f9084c04 - fix(components): 修复旋转 icon 未自适尺寸导致过大遮住元素 (5 days ago) <徐裕程> | * 9fb50fce - fix(components): 兼容清洗与泊车 (5 days ago) <38165> | * 2244220b - feat(components): 迁移显隐功能;修改显隐用户模版 (5 days ago) <38165> | * c5f7630d - feat(components): 迁移显隐功能(不含bev) (5 days ago) <38165> :...skipping... * 715bd39b - (HEAD -> feature/demo20250704) feat(components): 高度范围滑块提示 (3 days ago) <孙中明> * ec9872ec - feat(components): 降低俯仰旋转精度+可拖拽点至黑洞 (4 days ago) <孙中明> * 89afd4dc - feat(components): 界面-高度范围滑动条下方增加输入框 (4 days ago) <孙中明> * 9e0ee3c3 - feat(components): 四边形标注增加快捷键:G (5 days ago) <孙中明> * 9509ed84 - (origin/release_4.5.1, origin/master, origin/HEAD) Merge branch 'release_4.5.0' into 'master' (34 minutes ag 袁烨威> |\ | * 3c2f1aaa - (tag: V4.5.0-11, origin/release_4.5.0) fix(components): 修复非按需加载时,剩余的元素没有按照设置显隐 (3 days ) <38165> | * 70d143ad - (tag: V4.5.0-9, tag: V4.5.0-10) fix(components): 修复多边型无法选择单点进行删除 (4 days ago) <38165> | * 39a798c3 - fix(components): 绘制车道线,连续点击点生成线段时,线段未成功生成,左侧列表生成了线段id (4 days ago) <38165> | * 70acb100 - fix(components): 修复单点线段或线段点属性影响车道线展示 (4 days ago) <38165> | * 39da602b - (tag: V4.5.0-8) fix(components): 修复提交时indexDB错误 (4 days ago) <38165> | * 3fdf9fc4 - (tag: V4.5.0-7) fix(components): 修复无法提交 (4 days ago) <38165> | * 247c80a6 - (tag: V4.5.0-6, tag: V4.5.0-5) fix(utils): 调整多边形旋转 icon 位置 (4 days ago) <徐裕程> | * c89a1883 - (tag: V4.5.0-4) feat(components): 适配清洗的多边形隐藏 (4 days ago) <38165> | * f9b098f2 - (tag: V4.5.0-3) feat(components): 清洗 case 使用大华 data-mgr/finder 异步接口 (5 days ago) <徐裕程> | * f9084c04 - fix(components): 修复旋转 icon 未自适尺寸导致过大遮住元素 (5 days ago) <徐裕程> | * 9fb50fce - fix(components): 兼容清洗与泊车 (5 days ago) <38165> | * 2244220b - feat(components): 迁移显隐功能;修改显隐用户模版 (5 days ago) <38165> | * c5f7630d - feat(components): 迁移显隐功能(不含bev) (5 days ago) <38165> | * 34613552 - feat(components): 迁移切换图层功能 (6 days ago) <38165> | * c98cab69 - feat(components): 迁移快捷键与提交功能 (7 days ago) <38165> |/ * a22ce9a7 - Merge branch 'release_4.4.2' into 'master' (5 days ago) <袁烨威> |\ | * 18d158d4 - (tag: V4.4.2-11, origin/release_4.4.2) Merge branch 'release_4.4.1' into 'release_4.4.2' (7 days ago) <涂兵 | |\ | | * 8a9e1194 - fix(components): 修复快捷键k击两次才能退出bev (7 days ago) <袁烨威> :...skipping... * 715bd39b - (HEAD -> feature/demo20250704) feat(components): 高度范围滑块提示 (3 days ago) <孙中明> * ec9872ec - feat(components): 降低俯仰旋转精度+可拖拽点至黑洞 (4 days ago) <孙中明> * 89afd4dc - feat(components): 界面-高度范围滑动条下方增加输入框 (4 days ago) <孙中明> * 89afd4dc - feat(components): 界面-高度范围滑动条下方增加输入框 (4 days ago) <孙中明> * 9e0ee3c3 - feat(components): 四边形标注增加快捷键:G (5 days ago) <孙中明> * 89afd4dc - feat(components): 界面-高度范围滑动条下方增加输入框 (4 days ago) <孙中明> * 9e0ee3c3 - feat(components): 四边形标注增加快捷键:G (5 days ago) <孙中明> * 89afd4dc - feat(components): 界面-高度范围滑动条下方增加输入框 (4 days ago) <孙中明> * 9e0ee3c3 - feat(components): 四边形标注增加快捷键:G (5 days ago) <孙中明> * 9e0ee3c3 - feat(components): 四边形标注增加快捷键:G (5 days ago) <孙中明> * 9509ed84 - (origin/release_4.5.1, origin/master, origin/HEAD) Merge branch 'release_4.5.0' into 'master' (34 minutes ag |\ | * 3c2f1aaa - (tag: V4.5.0-11, origin/release_4.5.0) fix(components): 修复非按需加载时,剩余的元素没有按照设置显隐 (3 days | * 70d143ad - (tag: V4.5.0-9, tag: V4.5.0-10) fix(components): 修复多边型无法选择单点进行删除 (4 days ago) <38165> | * 39a798c3 - fix(components): 绘制车道线,连续点击点生成线段时,线段未成功生成,左侧列表生成了线段id (4 days ago) <38165> | * 70acb100 - fix(components): 修复单点线段或线段点属性影响车道线展示 (4 days ago) <38165> | * 39da602b - (tag: V4.5.0-8) fix(components): 修复提交时indexDB错误 (4 days ago) <38165> | * 3fdf9fc4 - (tag: V4.5.0-7) fix(components): 修复无法提交 (4 days ago) <38165> | * 247c80a6 - (tag: V4.5.0-6, tag: V4.5.0-5) fix(utils): 调整多边形旋转 icon 位置 (4 days ago) <徐裕程> | * c89a1883 - (tag: V4.5.0-4) feat(components): 适配清洗的多边形隐藏 (4 days ago) <38165> | * f9b098f2 - (tag: V4.5.0-3) feat(components): 清洗 case 使用大华 data-mgr/finder 异步接口 (5 days ago) <徐裕程> | * f9084c04 - fix(components): 修复旋转 icon 未自适尺寸导致过大遮住元素 (5 days ago) <徐裕程> | * 9fb50fce - fix(components): 兼容清洗与泊车 (5 days ago) <38165> | * 2244220b - feat(components): 迁移显隐功能;修改显隐用户模版 (5 days ago) <38165> | * c5f7630d - feat(components): 迁移显隐功能(不含bev) (5 days ago) <38165> | * 34613552 - feat(components): 迁移切换图层功能 (6 days ago) <38165> | * c98cab69 - feat(components): 迁移快捷键与提交功能 (7 days ago) <38165> |/ * a22ce9a7 - Merge branch 'release_4.4.2' into 'master' (5 days ago) <袁烨威> |\ | * 18d158d4 - (tag: V4.4.2-11, origin/release_4.4.2) Merge branch 'release_4.4.1' into 'release_4.4.2' (7 days ago) <涂兵 | |\ | | * 8a9e1194 - fix(components): 修复快捷键k击两次才能退出bev (7 days ago) <袁烨威> | |/ | * b33dc435 - (tag: V4.4.2-10) fix(components): 修复线段历史脏数据 (7 days ago) <38165> | * bca59d32 - fix(components): 修复分割线段存在多余无用的点 (10 days ago) <38165> | * 7840ee83 - fix(utils): 修复按 D 选中线段属性面板展示不正确的问题 (10 days ago) <徐裕程> 48138@C030116 MINGW64 /d/project/Annotation/LP_Annotation_LaneMap (feature/demo20250704) $ git checkout -b feature_xxx Switched to a new branch 'feature_xxx' 48138@C030116 MINGW64 /d/project/Annotation/LP_Annotation_LaneMap (feature_xxx) $ git push fatal: The current branch feature_xxx has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin feature_xxx To have this happen automatically for branches without a tracking upstream, see 'push.autoSetupRemote' in 'git help config'. 48138@C030116 MINGW64 /d/project/Annotation/LP_Annotation_LaneMap (feature_xxx) $ git push --set-upstream origin feature_xxx^C 48138@C030116 MINGW64 /d/project/Annotation/LP_Annotation_LaneMap (feature_xxx) $ git checkout -b feature_rotate_optimization_20250730 Switched to a new branch 'feature_rotate_optimization_20250730' 48138@C030116 MINGW64 /d/project/Annotation/LP_Annotation_LaneMap (feature_rotate_optimization_20250730) $ git push fatal: The current branch feature_rotate_optimization_20250730 has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin feature_rotate_optimization_20250730 To have this happen automatically for branches without a tracking upstream, see 'push.autoSetupRemote' in 'git help config'. 48138@C030116 MINGW64 /d/project/Annotation/LP_Annotation_LaneMap (feature_rotate_optimization_20250730) $ \ > git push --set-upstream origin feature_rotate_optimization_20250730 Enumerating objects: 43, done. Counting objects: 100% (43/43), done. Delta compression using up to 12 threads Compressing objects: 100% (28/28), done. Writing objects: 100% (29/29), 3.43 KiB | 438.00 KiB/s, done. Total 29 (delta 22), reused 0 (delta 0), pack-reused 0 (from 0) remote: branch_name:feature_rotate_optimization_20250730 remote: remote: To create a merge request for feature_rotate_optimization_20250730, visit: remote: http://gitlab-esd.leapmotor.com/iov/Platform_Front_end/LP_Annotation_LaneMap/-/merge_requests/new?merge_request%5h%5D=feature_rotate_optimization_20250730 remote: To http://gitlab-esd.leapmotor.com/iov/Platform_Front_end/LP_Annotation_LaneMap.git * [new branch] feature_rotate_optimization_20250730 -> feature_rotate_optimization_20250730 branch 'feature_rotate_optimization_20250730' set up to track 'origin/feature_rotate_optimization_20250730'. 48138@C030116 MINGW64 /d/project/Annotation/LP_Annotation_LaneMap (feature_rotate_optimization_20250730) $ 48138@C030116 MINGW64 /d/project/Annotation/LP_Annotation_LaneMap (feature_rotate_optimization_20250730) $ git pull origin release_4.5.1 --rebase remote: Enumerating objects: 23, done. remote: Counting objects: 100% (23/23), done. remote: Compressing objects: 100% (11/11), done. remote: Total 12 (delta 8), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (12/12), 2.53 KiB | 70.00 KiB/s, done. From http://gitlab-esd.leapmotor.com/iov/Platform_Front_end/LP_Annotation_LaneMap * branch release_4.5.1 -> FETCH_HEAD 9509ed84..629f55a2 release_4.5.1 -> origin/release_4.5.1 Successfully rebased and updated refs/heads/feature_rotate_optimization_20250730. 48138@C030116 MINGW64 /d/project/Annotation/LP_Annotation_LaneMap (feature_rotate_optimization_20250730) $ git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset' * e828d8c4 - (HEAD -> feature_rotate_optimization_20250730) feat(components): 高度范围滑块提示 (3 days ago) <孙中明> * a9bd849f - feat(components): 降低俯仰旋转精度+可拖拽点至黑洞 (4 days ago) <孙中明> * f44b97b4 - feat(components): 界面-高度范围滑动条下方增加输入框 (4 days ago) <孙中明> * 5d3d3720 - feat(components): 四边形标注增加快捷键:G (5 days ago) <孙中明> * 629f55a2 - (origin/release_4.5.1) feat(components): 4D可视化 (28 minutes ago) <38165> * 9509ed84 - (origin/master, origin/HEAD) Merge branch 'release_4.5.0' into 'master' (38 minutes ago) <袁烨威> |\ | * 3c2f1aaa - (tag: V4.5.0-11, origin/release_4.5.0) fix(components): 修复非按需加载时,剩余的元素没有按照设置显隐 (3 days| * 70d143ad - (tag: V4.5.0-9, tag: V4.5.0-10) fix(components): 修复多边型无法选择单点进行删除 (4 days ago) <38165> | * 39a798c3 - fix(components): 绘制车道线,连续点击点生成线段时,线段未成功生成,左侧列表生成了线段id (4 days ago) <38165> | * 70acb100 - fix(components): 修复单点线段或线段点属性影响车道线展示 (4 days ago) <38165> | * 39da602b - (tag: V4.5.0-8) fix(components): 修复提交时indexDB错误 (4 days ago) <38165> | * 3fdf9fc4 - (tag: V4.5.0-7) fix(components): 修复无法提交 (4 days ago) <38165> | * 247c80a6 - (tag: V4.5.0-6, tag: V4.5.0-5) fix(utils): 调整多边形旋转 icon 位置 (4 days ago) <徐裕程> | * c89a1883 - (tag: V4.5.0-4) feat(components): 适配清洗的多边形隐藏 (4 days ago) <38165> | * f9b098f2 - (tag: V4.5.0-3) feat(components): 清洗 case 使用大华 data-mgr/finder 异步接口 (5 days ago) <徐裕程> | * f9084c04 - fix(components): 修复旋转 icon 未自适尺寸导致过大遮住元素 (5 days ago) <徐裕程> | * 9fb50fce - fix(components): 兼容清洗与泊车 (5 days ago) <38165> | * 2244220b - feat(components): 迁移显隐功能;修改显隐用户模版 (5 days ago) <38165> * a22ce9a7 - Merge branch 'release_4.4.2' into 'master' (5 days ago) <袁烨威> |\ | * 18d158d4 - (tag: V4.4.2-11, origin/release_4.4.2) Merge branch 'release_4.4.1' into 'release_4.4.2' (7 days ago) <涂兵 兵> | |\ | | * 8a9e1194 - fix(components): 修复快捷键k击两次才能退出bev (7 days ago) <袁烨威> | |/ | * b33dc435 - (tag: V4.4.2-10) fix(components): 修复线段历史脏数据 (7 days ago) <38165> | * bca59d32 - fix(components): 修复分割线段存在多余无用的点 (10 days ago) <38165> 48138@C030116 MINGW64 /d/project/Annotation/LP_Annotation_LaneMap (feature_rotate_optimization_20250730) $ git push -f Enumerating objects: 43, done. Counting objects: 100% (43/43), done. Delta compression using up to 12 threads Compressing objects: 100% (28/28), done. Writing objects: 100% (29/29), 3.43 KiB | 439.00 KiB/s, done. Total 29 (delta 22), reused 0 (delta 0), pack-reused 0 (from 0) remote: branch_name:feature_rotate_optimization_20250730 remote: remote: To create a merge request for feature_rotate_optimization_20250730, visit: remote: http://gitlab-esd.leapmotor.com/iov/Platform_Front_end/LP_Annotation_LaneMap/-/merge_requests/new?merge_request%5Bsource_branch%5D=feature_rotate_optimization_20250730 remote: To http://gitlab-esd.leapmotor.com/iov/Platform_Front_end/LP_Annotation_LaneMap.git + 715bd39b...e828d8c4 feature_rotate_optimization_20250730 -> feature_rotate_optimization_20250730 (forced update)
08-05
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值