2012-02-29 26 views
2

基本上我讀過git合併衝突指南,我不確定它直接解決我的情況。我在子模塊中有衝突,我只想使用他們的版本,我知道它是git diff -3 app/bundles我該如何使用子模塊的版本,解決衝突並提交?Git合併衝突的子模塊。我只想提交他們的版本。怎麼樣?

~/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 

回答

9

如果我理解正確,你想擺脫子模塊中的所有更改?如果是這樣,請進入子模塊,重置並將更改提交到外部回購。

cd app/bundles

請重新驗證的哈希值。您的所有更改都將丟失。

git reset --hard ae6acdce79748ffba68504512536abf2b2b2ddf0

cd ../..

git add app/bundles

git commit

希望這是你想要達到的目標。

相關問題