Estimated read time: 1 minutes
if you use rsync to copy your git repo (i mean a non-bare repo here: a repo with a working dir + a .git one), git diff
will show that you touched your files. using git checkout -f
can be a workaround to hide those changes, but then when you rsync again, it'll see that git thouched those files, so it'll re-download all the tracked files. infinite loop. so here is a trick from gitte: using
git update-index --refresh
the index itself will be updated, not the tracked files. this was rsync will only re-download the index which is far less time, compared to the original one :)