I'm rebasing my branch on origin/master using
git pull --rebase origin master
Now I get some merge conflicts regarding git submodule updates:
diff --cc cpp_lib
index c14a3fe5,71b17a71..00000000
--- a/cpp_lib
+++ b/cpp_lib
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit c14a3fe5ad7b3034b9744c607c74c19e70b53da6
-Subproject commit 71b17a718561e8c3ff25523be75c1b36d3a0e585
++Subproject commit f9b7854b5f347be99a265b4acc47b265425380fa
Since I'm not really attached to my changes to the submodule ref I would like to drop the change to the new ref that I introduced and go with their change. So essentially I want to drop out the update to the submodule from the commit's DELTA so there will also be no further merge conflicts. How can I do that?
I'm rebasing my branch on origin/master using
git pull --rebase origin master
Now I get some merge conflicts regarding git submodule updates:
diff --cc cpp_lib
index c14a3fe5,71b17a71..00000000
--- a/cpp_lib
+++ b/cpp_lib
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit c14a3fe5ad7b3034b9744c607c74c19e70b53da6
-Subproject commit 71b17a718561e8c3ff25523be75c1b36d3a0e585
++Subproject commit f9b7854b5f347be99a265b4acc47b265425380fa
Since I'm not really attached to my changes to the submodule ref I would like to drop the change to the new ref that I introduced and go with their change. So essentially I want to drop out the update to the submodule from the commit's DELTA so there will also be no further merge conflicts. How can I do that?
Share Improve this question edited Mar 4 at 10:26 jonrsharpe 122k30 gold badges268 silver badges476 bronze badges asked Mar 3 at 13:14 gladesglades 4,9982 gold badges22 silver badges64 bronze badges 1 |1 Answer
Reset to default 0git checkout --ours cpp_lib
git add cpp_lib
git rebase --continue
Reset the submodule reference to the upstream version
git checkout --ours cpp_lib
Mark the conflict as resolved
git add cpp_lib
Continue the rebase
git rebase --continue
git pull --rebase
, butgit fetch
+git rebase
. The two forms are not equivalent.git pull --rebase
contains special/additional logic that could get you to lose local commits, if the remote happens to look as if its history has been re-written by dropping its last commits. For more details, I recommend reading this amazing answer by @BertF stackoverflow/questions/78802778/… – dani-vta Commented Mar 3 at 13:50