4

基本上我已经阅读了 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
4

1 回答 1

11

如果我理解正确,您想摆脱子模块中的所有更改吗?如果是这样,cd 进入子模块,重置并将更改提交到外部 repo。

cd app/bundles

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

git reset --hard ae6acdce79748ffba68504512536abf2b2b2ddf0

cd ../..

git add app/bundles

git commit

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

于 2012-02-29T23:38:20.607 回答