当前位置: 动力学知识库 > 问答 > 编程问答 >

How to change location of backup files left by failed git mergetool

问题描述:

When I use git merge tool and cancel it with Ctrl+C, following files are left in repository:

app/controllers/application_controller.rb.orig

app/controllers/application_controller.rb.BACKUP.22361.rb

app/controllers/application_controller.rb.BASE.22361.rb

app/controllers/application_controller.rb.LOCAL.22361.rb

app/controllers/application_controller.rb.REMOTE.22361.rb

Can I change the location of these files, so they are not written to the repository at all, even temporarily? For example to ~/.mergefiles

网友答案:

If you don't feel a strong need keep the temporary files from a broken merge at all, you may prefer to delete them entirely. To do so, set the following git config line, which will prevent them from being left behind if the mergetool exits with an error:

git config --global mergetool.keepBackup false

You may need to change some internal settings in your mergetool too, in case it's also saving backups after failed merges. If, on the other hand, you find yourself in need of the temporary files for some reason, this may not be the solution for you.

分享给朋友:
您可能感兴趣的文章:
随机阅读: