We're getting git installed here at work for a project and I'm playing around with it with another co-worker.
I've been resolving some choreographed merge conflicts but I'm ending up with a bunch of extra files I don't want. They are .BACKUP .BASE, .LOCAL and .REMOTE files. Based on those names, they seem to be coming from resolving my merges. Some exact file names I'm getting are:
Is it possible to not save these files? As you can imagine, it's kind of annoying to now have 9 versions of index.shtml. I'm using git's built-in merge tool, tortoisemerge.
I ran into something similar by running git log, it apparently created a "df" file. That was easy enough to deal with by just including it in a .gitignore file. I don't want to just accumulate files like above throughout the project, though.
As the other answer mentions, these files seem to be created by Git's merge tool when resolving conflicts. The default Git settings leave these extra files behind, even after the conflict is resolved, but current versions of Git allow you to set a config variable to cause Git to always delete these temporary files after finishing the merge.
You can do this in Git Bash with the command...
git config --global mergetool.keepBackup false
The --global
argument is optional, of course, and controls whether this setting is local to this user (global) or the current repository.
More info here.
Edit: Even with this setting enabled, these files can also accumulate and persist if your repo ends up in an unresolved state during a MERGE that you attempt to fix by aborting with a hard reset.
For example, this happened to me several times using certain configurations of Qt Creator 4.7.x until I realized what was happening and correctly configured Git's mergetool
on my machine.
Note: I had a similar question and ended up here. Although the current answer eventually led me to the correct solution, I didn't feel that it answered the question and an updated answer was in order.
In Tortoise, go to setting and uncheck "Backup original file" (one time operation) Next time you open it you can do a regular merge, Tortoise will create .base, .backup, .local, .remote, but when you save the merge Tortoise will automatically remove this files.
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