Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git submodules are being -dirty?

I just cloned a repository as a submodule into one of my projects. Al is well and working, but all of a sudden i get this message when I do git status;

# 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:   wp-content/plugins/advanced-custom-fields (untracked content
)
#

And if I do git diff I get the following:

-Subproject commit 486e51db9b6ce49114c897ed1893a208d2289a29
+Subproject commit 486e51db9b6ce49114c897ed1893a208d2289a29-dirty

What is worrying is the -dirty change. What does it mean? How do I fix it? I havent made any changes to the repository. But Dreamweaver may have added stupid _notes folders to it. I have tried to delete them but still have same problem. Is this what is causing it to be dirty?

If I try and do a git add -A it still says I have untracked content.

Any ideas?

like image 206
jamietelin Avatar asked Feb 11 '13 13:02

jamietelin


People also ask

What are git submodules for?

Git submodules allow you to keep a git repository as a subdirectory of another git repository. Git submodules are simply a reference to another repository at a particular snapshot in time. Git submodules enable a Git repository to incorporate and track version history of external code.

Where are git submodules defined?

1.1. A submodule can be located anywhere in a parent Git repository's working directory and is configured via a . gitmodules file located at the root of the parent repository. This file contains which paths are submodules and what URL should be used when cloning and fetching for that submodule.

Are git submodules a good idea?

Its more accurate to say that git submodules are useful when you want to share code that you also need change along with the consumer of that code. If you're not trying to change the shared code along with the consumer of that code, there are better options for sharing your code.

What does git pull -- recurse submodules do?

If you pass --recurse-submodules to the git clone command, it will automatically initialize and update each submodule in the repository, including nested submodules if any of the submodules in the repository have submodules themselves.


1 Answers

the -dirty suffix means the submodule has changed. do this:

cd wp-content/plugins/advanced-custom-fields

then

git status

and you'll see what changes are causing your submodule to be dirty.

like image 53
Woodrow Douglass Avatar answered Sep 29 '22 23:09

Woodrow Douglass