Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git submodules with modified and untracked content - why and how to remove it?

Tags:

git

this is what my git status' result looks like:

# On branch master # Changed but not updated: #   (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:   vim/bundle/pathogen (modified content) #   modified:   vim/bundle/sparkup (untracked content) # no changes added to commit (use "git add" and/or "git commit -a") 

running git diff vim shows this:

diff --git a/vim/bundle/pathogen b/vim/bundle/pathogen --- a/vim/bundle/pathogen +++ b/vim/bundle/pathogen @@ -1 +1 @@ -Subproject commit fcf77f5101f3e589ce006c40ad3a0432735a05cf +Subproject commit fcf77f5101f3e589ce006c40ad3a0432735a05cf-dirty diff --git a/vim/bundle/sparkup b/vim/bundle/sparkup --- a/vim/bundle/sparkup +++ b/vim/bundle/sparkup @@ -1 +1 @@ -Subproject commit 04a81b41f116a19184359a6f8685c192f5c36c70 +Subproject commit 04a81b41f116a19184359a6f8685c192f5c36c70-dirty 

Why is the one untracked, the other modified, what does the diff mean? But most important: how did it happen and how to get rid of it?

like image 1000
nocksock Avatar asked Nov 03 '11 10:11

nocksock


People also ask

How do I fix modified content untracked content?

You can delete the git repository from the untracked or untraceable folder by command ---->rmdir -Force -Recurse . git This command will delete the local git repo in your untracebale or untracked directory and once again go to your root folder and type the same command. Reinitialize the git repo and its Done!!!


1 Answers

One of the tracked files in vim/bundle/pathogen has been modified somehow. There is also some untracked (and unignored) content in the submodule vim/bundle/sparkup. In either case, the way to figure out what is modified / untracked is to change into the submodule directory and run git status. (In the case of untracked files in a submodule, this is frequently a build product that has not been added to .gitignore in upstream.)

like image 126
Mark Longair Avatar answered Sep 21 '22 14:09

Mark Longair