When I rename an entire folder or do refactoring, I think it's good practice to isolate the rename operation on its own separate commit. If I mix it with other pending modifications, I'll only complicate the verification of the commit. So the commit should have only path rename operations with no other modifications, except when they are renamed references inherent to the refactoring operation (but I would manually stage those).
Is there a simple git command (or shell script / function that I could add to ~/.bash_aliases) that I can use to stage all files that were renamed with no other modifications, and only those?
For simplicity, you may assume nothing else is staged, so you could make it 2 step like:
- stage all files
- unstage all files that have modifications other than just path renaming
How would I do that?