I see ignore = dirty
in a .gitmodule
file.
Example:
[submodule "docs/submodules/netvirt"]
path = docs/submodules/netvirt
url = ../netvirt
branch = .
ignore = dirty
The documentation states:
"dirty" will ignore all changes to the submodules work tree and takes only differences between the HEAD of the submodule and the commit recorded in the superproject into account.
I cant understand what this means. Can someone state this in a simple language?
What I understand is that say when I added the submodule to the super project, it was at state C (HEAD at C) and then later after sometime its now at state F (HEAD at F). ignore=dirty
will only consider changes D, E, F ( which is what it should do! )
Clearly, I have misunderstood something. What is it?
The term "dirty" here means the same as it does elsewhere in Git: the repo in question has tracked files (files that have previously been committed) that have modifications that have not been committed, and/or there are new untracked files.
In the context of the ignore = dirty
setting for submodules, this means that if the submodule is dirty (i.e. if it has tracked files with modifications that have not been committed, and/or new untracked files), such changes will be ignored. What will not be ignored is a difference in the checked-out commit, e.g. where the parent project points to commit C
but the submodule currently has commit F
checked out.
These are the possible states for the submodule, and the status in the parent project with the setting ignore = dirty
:
ignore = dirty
).ignore = dirty
).If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With