1

git on OSX sees a modified subdir, but won't 'add' it; how can I fix this? THANKS! (I don't believe there are any open files in that subdir)

~/gitrepo/python: git status
# On branch br1
# 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)
#   (commit or discard the untracked or modified content in submodules)
#
#   modified:   v0/mage-Upload (modified content)
#
no changes added to commit (use "git add" and/or "git commit -a")
~/gitrepo/python: git add v0
~/gitrepo/python: git add v0/mage-Upload    <-- I guess that was unnecessary
~/gitrepo/python: git diff
diff --git a/v0/mage-Upload b/v0/mage-Upload
--- a/v0/mage-Upload
+++ b/v0/mage-Upload
@@ -1 +1 @@
-Subproject commit 7c377092f1f5cbbeecc03ebb533259c23606506e
+Subproject commit 7c377092f1f5cbbeecc03ebb533259c23606506e-dirty
~/gitrepo/python: git commit -a
# On branch br1
# 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)
#   (commit or discard the untracked or modified content in submodules)
#
#   modified:   v0/mage-Upload (modified content)
#
no changes added to commit (use "git add" and/or "git commit -a")
1
  • It says commit or discard the untracked or modified content in submodules ... you are using submodules. Commented Jun 20, 2012 at 14:33

3 Answers 3

5

Try to remove it from the cache and then re-add it

git rm --cached v0
git add v0
Sign up to request clarification or add additional context in comments.

5 Comments

can I blow away .git/ and just re-initialize local repo?
I'm not sure how you have your project setup, but in my experience with git deleting stuff and trying to start over usually ends up in more of a headache somewhere else (unless it's all from starch).
ok, thanks for your comments. BTW: How should I 'close' / terminate this SO question?
I don't believe either of us has enough points to do that. I would just leave it open. Someone may still come along with a better answer.
I see there is a mystery .git/ in the subdir; looks like a possible duplicate: stackoverflow.com/questions/5186371/…
2

You apparently have a submodule in 'v0/mage-Upload' - you will need to handle the changes in the submodule before the changes in the 'super module'. Do something like:

cd vo/mage-Upload
git status
git commit    # Careful if the submodule is not on a branch
              #   see 'git submodule' documentation
git push ...  # Specific to your submodule

At this point you can return the the 'super module' and commit the change to the submodule reference.

Comments

0

mage-Upload is a Git submodule. You should do the following:

cd vo/mage-Upload
git commit -a (or whatever you want to commit)
cd ../..
git commit -a

That will commit any changes in the submodule, then commit the new submodule version to the main repository.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.