gpt4 book ai didi

子模块中的 Git Merge 冲突。如何提交他们的版本?

转载 作者:太空狗 更新时间:2023-10-29 13:49:48 28 4
gpt4 key购买 nike

基本上我已经阅读了 git merge 冲突指南,但我不确定它是否直接解决了我的情况。我在子模块中有冲突,我只想使用他们的版本,据我所知是 git diff -3 app/bundles 我如何只使用子模块的那个版本,解决冲突并提交?

~/projects/sms/admin(rc)$ git diff
diff --cc app/bundles
index 999fd0a,ae6acdc..0000000
--- a/app/bundles
+++ b/app/bundles
~/projects/sms/admin(rc)$ git diff -1 app/bundles
* Unmerged path app/bundles
diff --git a/app/bundles b/app/bundles
index b34a733..999fd0a 160000
--- a/app/bundles
+++ b/app/bundles
@@ -1 +1 @@
-Subproject commit b34a73375b4dfed6086d26d205ab5535acece053
+Subproject commit 999fd0a307e6d8d517ddf3dd6fab28a3ac0ec2c9
~/projects/sms/admin(rc)$ git diff -2 app/bundles
* Unmerged path app/bundles
~/projects/sms/admin(rc)$ git diff -3 app/bundles
* Unmerged path app/bundles
diff --git a/app/bundles b/app/bundles
index ae6acdc..999fd0a 160000
--- a/app/bundles
+++ b/app/bundles
@@ -1 +1 @@
-Subproject commit ae6acdce79748ffba68504512536abf2b2b2ddf0
+Subproject commit 999fd0a307e6d8d517ddf3dd6fab28a3ac0ec2c9

最佳答案

如果我没理解错的话,您想删除子模块中的所有更改吗?如果是,则 cd 进入子模块,重置并将更改提交到外部仓库。

cd app/bundle

请再次验证哈希值。您的所有更改都将丢失。

git reset --hard ae6acdce79748ffba68504512536abf2b2b2ddf0

cd ../..

git 添加应用程序/ bundle

提交

希望这就是您想要实现的目标。

关于子模块中的 Git Merge 冲突。如何提交他们的版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9505124/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com