Dirty subproject detected by Git diff

NilsH’s guide on ignoring changes in git submodules, discovered through the Vimcast episode on syncing plugins with git submodules and pathogen.


After successfully cloning a repository as a submodule into my project, everything was functioning properly. However, I suddenly received a message when attempting to execute

git status


# Changes not staged for commit:
#   (use "git add ..." to update what will be committed)
#   (use "git checkout -- ..." 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

Upon performing

git diff

, the resulting output is as follows:

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

The “dirty change” is causing concern. Its significance and the steps to resolve it are unclear. Although no alterations were made to the repository, there may be unwanted “_notes” folders added by Dreamweaver. Despite attempts to remove them, the issue persists. Is this the root cause of the “dirty change”?

Even after attempting to execute

git add -A

, the system still indicates the presence of untracked content.

Any ideas?

Solution 1:

Perform the following action when the submodule is marked with the ‘-dirty’ suffix, indicating a modification.

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


git status

By checking, you can identify the modifications that are leading to your submodule being marked as unclean.

Solution 2:

As I suspected, the issue stemmed from the creation of *_notes* folders by Dreamweaver. I discovered a solution for disabling this feature by referring to http://forums.adobe.com/docs/DOC-1671.

As per the suggestion of @Woodrow Douglass, I had to inspect my submodule directory for any modifications. Upon inspection, it was discovered that numerous folders named *_notes* had been generated.

Solution 3:


git add wp-content/plugins/advanced-custom-fields

Frequently Asked Questions

Posted in Git