How do I make git clean (or smudge) modify files in my local repository

1k Views Asked by At

I'm using git filters (specifically clean) to sort some xml files before checking them into the repository. However, the local files remain as they were - even a smudge filter doesn't do anything (presumably since they haven't been checked out).

Thus, if we do a diff using an IDE for example, it will compare against the file on disk - thus showing incorrect diffs vs what was actually committed to the repo.

Is there any way to force git to re-check-out on commit, so that the local file mirrors what is in the staging area?

1

There are 1 best solutions below

0
On

I proposed an alias in order to force the index to be checked out again.

But you can also limit the checkout to only the files with a smudge filter.