子模块中的Git Merge冲突。我只想承诺他们的版本。怎么样?

时间:2012-02-29 19:07:57

标签: git git-submodules git-merge tree-conflict

基本上我已经阅读了git merge conflict指南,我不确定它是否直接解决了我的情况。我在子模块中存在冲突,我只想使用我理解的版本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

1 个答案:

答案 0 :(得分:9)

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

cd app/bundles

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

git reset --hard ae6acdce79748ffba68504512536abf2b2b2ddf0

cd ../..

git add app/bundles

git commit

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