【git】main|REBASE 2/6

embedded/2024/10/9 1:06:22/

  • 很久没合并代码
  • 合并出现冲突,自动进入了 main|REBASE 2/6 的提示:

gitmainREBASE_26_5">【git】main|REBASE 2/6

It looks like you’ve encountered several merge conflicts after a git pull operation while a rebase is in progress. Here’s how you can resolve these conflicts and proceed with your rebase:

Resolve Merge Conflicts Manually:

Open the conflicting files in your code editor.
Look for the conflict markers (<<<<<<<, =======, >>>>>>>). These mark the conflicting changes from the local and remote versions.
Decide how to integrate changes from both sides or choose one side over the other.
After resolving each conflict in a file, save the file.
Mark Conflicts as Resolved:

Use git add for each file you resolve to mark it as resolved. Do not use git commit yet as the rebase process will handle committing for you.
Continue the Rebase:

Once all conflicts are resolved and the files are added, continue the rebase by running:

git rebase --continue

This will apply the next commit in the rebase queue and might result in more conflicts. Repeat the resolution process as needed.
Skip the Problematic Commit (if you decide the commit causing conflicts should not be applied):

You can use:

git rebase --skip

This will ignore the commit that causes the conflict and move to the next commit.
Abort the Rebase (if you decide to return to the original state before the rebase started):

You can abort the rebase which will return your branch to the original state before the rebase started:

git rebase --abort

It’s important to carefully review the changes and ensure that the resolution maintains the integrity and functionality of the code. If the rebase was unintentional or if you’re unsure about how to resolve conflicts, it might be safer to discuss with your team or check with the repository’s main contributor.

我的修复

zhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main)
$ git pull
remote: Enumerating objects: 772, done.
remote: Counting objects: 100% (772/772), done.
remote: Compressing objects: 100% (661/661), done.
remote: Total 772 (delta 118), reused 712 (delta 104), pack-reused 0
Receiving objects: 100% (772/772), 25.54 MiB | 10.37 MiB/s, done.
Resolving deltas: 100% (118/118), completed with 9 local objects.dd374ac3..e80e2164  main       -> origin/main
Auto-merging .gitignore
CONFLICT (content): Merge conflict in .gitignore
Auto-merging Bifrost-202403/worker/src/bifrost/experiment_manager/h264_file_data_producer.cpp
CONFLICT (content): Merge conflict in Bifrost-202403/worker/src/bifrost/experiment_manager/h264_file_data_producer.cpp
warning: Cannot merge binary files: player-only/worker/third_party/libwebrtc/deps/abseil-cpp/abseil-cpp_m77/out32/Debug/absl.lib (HEAD vs. 4db9a18e (同步13900k的修改,主要合并了player-only、2403版本的wsl2调试))
Auto-merging player-only/worker/third_party/libwebrtc/deps/abseil-cpp/abseil-cpp_m77/out32/Debug/absl.lib
CONFLICT (content): Merge conflict in player-only/worker/third_party/libwebrtc/deps/abseil-cpp/abseil-cpp_m77/out32/Debug/absl.lib
Auto-merging player-only/worker/third_party/libwebrtc/libwebrtc/modules/pacing/paced_sender.cc
error: could not apply 4db9a18e... 同步13900k的修改,主要合并了player-only、2403版本的wsl2调试
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 4db9a18e... 同步13900k的修改,主要合并了player-only、2403版本的wsl2调试zhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main|REBASE 2/6)
$zhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main|REBASE 2/6)
$zhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main|REBASE 2/6)
$ git rebase --continue
Auto-merging .gitignore
CONFLICT (content): Merge conflict in .gitignore
error: could not apply 0c2cdc98... 忽略俩264文件
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 0c2cdc98... 忽略俩264文件zhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main|REBASE 3/6)
$ git rebase --continue
.gitignore: needs merge
You must edit all merge conflicts and then
mark them as resolved using git addzhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main|REBASE 3/6)
$ git rebase --continue
[detached HEAD 2a348e6d] 忽略俩264文件1 file changed, 3 insertions(+), 1 deletion(-)
CONFLICT (modify/delete): player-only/worker/third_party/libwebrtc/deps/abseil-cpp/abseil-cpp_m77/out32/Debug/absl.pdb deleted in f466da41 (abseil的m77版本的absl不上传) and modified in HEAD.  Version HEAD of player-only/worker/third_party/libwebrtc/deps/abseil-cpp/abseil-cpp_m77/out32/Debug/absl.pdb left in tree.
error: could not apply f466da41... abseil的m77版本的absl不上传
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply f466da41... abseil的m77版本的absl不上传zhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main|REBASE 6/6)
$ git rebase --continue
player-only/worker/third_party/libwebrtc/deps/abseil-cpp/abseil-cpp_m77/out32/Debug/absl.pdb: needs merge
You must edit all merge conflicts and then
mark them as resolved using git addzhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main|REBASE 6/6)
$ git rebase --abortzhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main)
$

重新push pull:刚才的修改都丢失了


zhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main)
$ git push! [rejected]          main -> main (non-fast-forward)hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. If you want to integrate the remote changes,
hint: use 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.zhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main)
$ git pull
Auto-merging .gitignore
CONFLICT (content): Merge conflict in .gitignore
Auto-merging Bifrost-202403/worker/src/bifrost/experiment_manager/h264_file_data_producer.cpp
CONFLICT (content): Merge conflict in Bifrost-202403/worker/src/bifrost/experiment_manager/h264_file_data_producer.cpp
warning: Cannot merge binary files: player-only/worker/third_party/libwebrtc/deps/abseil-cpp/abseil-cpp_m77/out32/Debug/absl.lib (HEAD vs. 4db9a18e (同步13900k的修改,主要合并了player-only、2403版本的wsl2调试))
Auto-merging player-only/worker/third_party/libwebrtc/deps/abseil-cpp/abseil-cpp_m77/out32/Debug/absl.lib
CONFLICT (content): Merge conflict in player-only/worker/third_party/libwebrtc/deps/abseil-cpp/abseil-cpp_m77/out32/Debug/absl.lib
Auto-merging player-only/worker/third_party/libwebrtc/libwebrtc/modules/pacing/paced_sender.cc
error: could not apply 4db9a18e... 同步13900k的修改,主要合并了player-only、2403版本的wsl2调试
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 4db9a18e... 同步13900k的修改,主要合并了player-only、2403版本的wsl2调试zhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main|REBASE 2/6)
$ ^Czhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main|REBASE 2/6)
$

本地修改后后强制覆盖线上版本

如果你想要在Git中强制使用本地的更改覆盖远程仓库的更改(例如在解决合并冲突后),你可以使用以下步骤来强制推送:

确保你的本地分支已正确设置: 确保你已经解决了所有合并冲突,并且你的本地分支包含了所有你希望在远程仓库中有的更改。

使用强制推送: 强制推送会使远程分支与你的本地分支同步,即使这意味着覆盖在远程分支上的更改。使用以下命令进行强制推送:

bash
复制代码
git push origin --force
或者使用更安全的方式,只强制推送你的当前分支:

bash
复制代码
git push --force-with-lease
这个命令在远程分支没有被其他人更新的情况下执行推送,这是一种更安全的做法,可以防止无意中覆盖其他人的更改。

警告:
强制推送是一个危险的操作,因为它会永久覆盖远程仓库中的更改。在进行强制推送前,最好确认与你的团队或项目的贡献者。
确保你理解强制推送会使远程仓库丢失所有未合并的更改。
通常,如果不是在个人项目或在确保所有团队成员都同意的情况下,应避免使用强制推送。
在团队环境中,建议在执行此类操作前进行充分的沟通。

我的操作


zhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main|REBASE 2/6)
$ git push --force-with-lease
fatal: You are not currently on a branch.
To push the history leading to the current (detached HEAD)
state now, usegit push origin HEAD:<name-of-remote-branch>zhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main|REBASE 2/6)
$ git push -^Corce-with-leasezhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main|REBASE 2/6)
$ git rebase --abortzhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main)
$ git push --force-with-lease
Enumerating objects: 123, done.
Counting objects: 100% (123/123), done.
Delta compression using up to 32 threads
Compressing objects:  98% (76/77)
Compressing objects: 100% (77/77), done.
Writing objects: 100% (81/81), 2.61 MiB | 5.65 MiB/s, done.
Total 81 (delta 54), reused 2 (delta 1), pack-reused 0
remote: Powered by GITEE.COM [1.1.5]
remote: Set trace flag 8545d1b1+ e80e2164...f466da41 main -> main (forced update)zhangbin@DESKTOP-1723CM1 MINGW64 /d/XTRANS/thunderbolt/ayame/zhb-bifrost (main)
$

http://www.ppmy.cn/embedded/123206.html

相关文章

OpenCV 形态学相关函数详解及用法示例

OpenCV形态学相关的运算包含腐蚀(MORPH_ERODE)&#xff0c;膨胀(MORPH_DILATE)&#xff0c;开运算(MORPH_OPEN)&#xff0c;闭运算(MORPH_CLOSE)&#xff0c;梯度运算(MORPH_GRADIENT)&#xff0c;顶帽运算(MORPH_TOPHAT)&#xff0c;黑帽运算(MORPH_BLACKHAT)&#xff0c;击中…

springboot系列--web相关知识探索三

一、前言 web相关知识探索二中研究了请求是如何映射到具体接口&#xff08;方法&#xff09;中的&#xff0c;本次文章主要研究请求中所带的参数是如何映射到接口参数中的&#xff0c;也即请求参数如何与接口参数绑定。主要有四种、分别是注解方式、Servlet API方式、复杂参数、…

有开源的杀毒软件吗?

有开源的杀毒软件&#xff0c;其中较为知名和广泛使用的是ClamAV&#xff08;Clam AntiVirus&#xff09;。以下是对ClamAV的详细介绍&#xff1a; 一、软件概述 ClamAV是一款免费的、跨平台的开源防病毒软件工具包&#xff0c;用C和C编写&#xff0c;并在GNU通用公共许可证下…

使用Electron将vue项目改桌面程序

1&#xff0c;一个简单的实现案例 # 切换镜像&#xff0c;其他镜像&#xff1a;https://registry.npm.taobao.org/ npm config set registry https://registry.npmmirror.com/ # 推荐使用yarn来管理依赖包&#xff0c;相对于Node.js自带的npm包管理工具来说&#xff0c;它具有…

正则表达式的使用示例--Everything文件检索批量重命名工具

一、引言 Everything是一款非常实用的文件搜索工具&#xff0c;它可以帮助您快速定位并查找计算机中的文件和文件夹。Everything搜索文件资料之神速&#xff0c;有使用过的朋友们都深有体会&#xff0c;相对于Windows自带的搜索功能&#xff0c;使用Everything&#xff0c;可以…

YOLOv11改进 | Neck篇 | YOLOv11引入Gold-YOLO

1. Gold-YOLO介绍 1.1 摘要: 在过去的几年中,YOLO 系列模型已成为实时目标检测领域的领先方法。 许多研究通过修改架构、增加数据和设计新的损失,将基线提升到更高的水平。 然而,我们发现以前的模型仍然存在信息融合问题,尽管特征金字塔网络(FPN)和路径聚合网络(PANet)…

【python面试宝典3】遍历文件夹

题目013&#xff1a;写一个函数统计传入的列表中每个数字出现的次数并返回对应的字典。 点评&#xff1a;送人头的题目&#xff0c;不解释。 def count_letters(items):result {}for item in items:if isinstance(item, (int, float)):result[item] result.get(item, 0) 1re…

C++(string类的实现)

1. 迭代器、返回capacity、返回size、判空、c_str、重载[]和clear的实现 string类的迭代器的功能就类似于一个指针&#xff0c;所以我们可以直接使用一个指针来实现迭代器&#xff0c;但如下图可见迭代器有两个&#xff0c;一个是指向的内容可以被修改&#xff0c;另一个则是指…