In a git merge conflict, what are the BACKUP, BASE, LOCAL, and REMOTE files that are generated?

后端 未结 2 812
说谎
说谎 2020-12-12 10:18

I assume the LOCAL and REMOTE files are just what their name suggests, but what are BASE and BACKUP for?

2条回答
  •  我在风中等你
    2020-12-12 11:03

    Git performs a three-way merge, finding the common ancestor (aka "merge base") of the two branches you are merging. When you invoke git mergetool on a conflict, it will produce these files suitable for feeding into a typical 3-way merge tool. Thus:

    • foo.LOCAL: the "ours" side of the conflict - ie, your branch (HEAD) that will contain the results of the merge
    • foo.REMOTE: the "theirs" side of the conflict - the branch you are merging into HEAD
    • foo.BASE: the common ancestor. useful for feeding into a three-way merge tool
    • foo.BACKUP: the contents of file before invoking the merge tool, will be kept on the filesystem if mergetool.keepBackup = true.

提交回复
热议问题