'In a git merge conflict, what are the BACKUP, BASE, LOCAL, and REMOTE files that are generated?
I assume the LOCAL and REMOTE files are just what their name suggests, but what are BASE and BACKUP for?
Solution 1:[1]
In case of pulling (merging) in changes from a online repository into your local copy, you can understand REMOTE, LOCAL and BASE as:
REMOTE= Your local file including own modifications ('as on the filesystem')LOCAL= The remote file inside the online repository ('changes made by other users')BASE= The origin of both files ('without any modifications')
The terms are from the point of view of the online repository which is what 'local' refers to. See also the wikipedia article about three-way merge.
Solution 2:[2]
According to https://git-scm.com/docs/git-mergetool
When git mergetool is invoked with this tool (either through the -t or --tool option or the merge.tool configuration variable) the configured command line will be invoked with $BASE set to the name of a temporary file containing the common base for the merge, if available; $LOCAL set to the name of a temporary file containing the contents of the file on the current branch; $REMOTE set to the name of a temporary file containing the contents of the file to be merged, and $MERGED set to the name of the file to which the merge tool should write the result of the merge resolution.
However, there seems to be a difference between a rebase command and a merge command.
Merge uses your local branch as LOCAL and the branch you're merging in as REMOTE
Rebase uses your local branch as REMOTE and the branch you're rebasing onto as LOCAL
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | FireEmerald |
| Solution 2 | Rikard |

