git .BACKUP .BASE .LOCAL .REMOTE files

前端 未结 3 1956
独厮守ぢ
独厮守ぢ 2021-02-18 15:55

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 b

相关标签:
3条回答
  • 2021-02-18 16:47

    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. Scroll down to the TEMPORARY FILES section at the bottom.


    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.

    0 讨论(0)
  • 2021-02-18 16:48

    To delete the untracked files and directories, type:

    git clean -df
    
    0 讨论(0)
  • 2021-02-18 17:02

    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.

    0 讨论(0)
提交回复
热议问题