Option to sync .git directory
ajdavis opened this issue · comments
I tried adding "--include .git" to the "mirror client" command line but it still seems to ignore the .git directory. I understand your reasons for ignoring it by default but I'd like to sync it. Is there a way to override the default exclude rule for .git?
Hey; there is not now, but it should be easy to add, around in here:
https://github.com/stephenh/mirror/blob/master/src/main/java/mirror/Mirror.java#L221
Something like --ignore-default-excludes
.
Are you up for submitting a PR?
Sure! Can you help me understand something first? (My Java's rudimentary.) What is the precedence of the "include" and "exclude" rules? Where's the code that applies these rules, so I can see how they interact with each other?
Nevermind, I must not have been testing correctly before. It turns out that "--include .git" works as I desire. I've submitted a new test to prove that, if you'd like.
@ajdavis haha, no worries, I had forgotten, includes do override excludes, because something might be .gitignored
but for some specific reason you do want it mirrored. Thanks for reporting back!