I'm using Git to track changes to XML configurations for virtual machines. Many of the XML configurations are similar, with just a few fields that are different. I often delete VM configurations and add new ones. When adding these changes to the repo, Git treats it as a file rename, with just a few changes. I could see why git would do this, and understand it's use case.
I'm wondering if there's a way to prevent that, and instead have git treat it as a file deletion with a new file creation instead. When looking at the commit logs, it would be much easier to discern "oh, looks like on this day I deleted this VM and created a new one"
Renames are only something shown in the output, internally they are stored just as regular deletions and creations.
If you want to disable the renames detection, you can use the --no-renames
option:
git log --stat --no-renames
(also works with git diff
, git show
, etc.)
If you don't want to add this option all the time, you can add it to your config:
git config diff.renames false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With