want to get file_3 by merging file_1 and file_2
if manual merge needed, text editor or merge tools can be used. preferably file_3 is in git merge like format.
file_1 is in git, but both with or without git to do the merge is fine
on Linux.
want to get file_3 by merging file_1 and file_2
if manual merge needed, text editor or merge tools can be used. preferably file_3 is in git merge like format.
file_1 is in git, but both with or without git to do the merge is fine
on Linux.
If you use git
, you could:
(Let's assume that the master
branch contains the file1
)
git co -b 0001-merging-one-file
file1
in this branch with file2
, via editor or by any other means ..git co master
git pull . 0001-merging-one-file
For the 3-way merging git uses you need THREE versions of the file: "ours" version, "theirs" version, i.e. versions you want to merge, but you also need "common" version, i.e. version of file that was common source for "ours" and "theirs" version; for Git it would be version from merge base of current branch and the branch you are merging.
The algorithm and the way to mark merge conflicts Git uses is nearly the same as the one used by rcsmerge
tool from RCS (long time ago Git required rcsmerge installed), and by diff3 -E
. You can run it by hand using low level (plumbing) command git merge-file
.