I've renamed a few files in my git repo, but I forgot to use git mv
to rename those files. I'd like to make my commit reflect the renamed files, instead of showing a deletion and an addition to the repo. Is it possible to do something like that?
Or would I have to create a kind of macro that uses mv
to move the file back to the original name, and then git mv
to rename it once again, like so:
function fixmv() { mv $2 $1 && git mv $1 $2 }
If there is a built-in way to do this using git, I'd love to hear.