Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore submodule dirty status on commit

I have a repository with a submodule. For me, this submodule is read-only, so I'm using submodule.Module.ignore=dirty.

This works fine for 'git status', but when I commit, the whole submodule is scanned and in git's comments I can see that it's dirty.

Is there a way to avoid this?

like image 400
orgads Avatar asked Nov 17 '11 12:11

orgads


1 Answers

If you really never want to see changes to the submodule, you can add a line to .git/info/exclude inside the submodule with a '*' pattern.

This will result in the submodule always reporting itself as clean, regardless of what has changed.

echo "*" >> path/to/submodule/.git/info/exclude
like image 129
Eric Avatar answered Oct 21 '22 01:10

Eric