2012-08-30 11 views
12

मैं एक Git submodule का सूचक प्रतिबद्ध बदल दिया है:गिट सबमिशन में परिवर्तन को कैसे हटाया जाए?

% git status 
# On branch fix 
# Your branch is behind 'origin/fix' by 1 commit, and can be fast-forwarded. 
# 
# Changes not staged for commit: 
# (use "git add <file>..." to update what will be committed) 
# (use "git checkout -- <file>..." to discard changes in working directory) 
# 
# modified: app/lib (new commits) 
# 
no changes added to commit (use "git add" and/or "git commit -a") 

फिर भी जब मैं git checkout करते हैं, कुछ भी नहीं बदलता है:

% git diff 
diff --git a/app/lib b/app/lib 
index d670460..83baae6 160000 
--- a/app/web-lib 
+++ b/app/web-lib 
@@ -1 +1 @@ 
-Subproject commit d670460b4b4aece5915caf5c68d12f560a9fe3e4 
+Subproject commit 83baae61804e65cc73a7201a7252750c76066a30 

किसी भी विचार क्यों यह:

% git checkout -- app/lib && git status 
# On branch fix 
# Your branch is behind 'origin/fix' by 1 commit, and can be fast-forwarded. 
# 
# Changes not staged for commit: 
# (use "git add <file>..." to update what will be committed) 
# (use "git checkout -- <file>..." to discard changes in working directory) 
# 
# modified: app/lib (new commits) 
# 
no changes added to commit (use "git add" and/or "git commit -a") 

यहाँ diff है होता है?

धन्यवाद!

उत्तर

16

गिट स्वचालित रूप से submodules को अद्यतन नहीं करता है जब उनमें एसएचए बदल जाता है।

आप git submodule update के लिए या तो की जरूरत है जो submodule वापस की उम्मीद SHA, या git add app/lib जो submodule में वर्तमान मूल्य को उम्मीद SHA बदल जाएगा करने के लिए रखा जाएगा।

संबंधित मुद्दे