Skip to content

Commit 0e545f7

Browse files
committed
Documentation: describe 'union' low-level merge driver
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent cc21682 commit 0e545f7

File tree

3 files changed

+41
-4
lines changed

3 files changed

+41
-4
lines changed

Documentation/git-check-attr.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ OPTIONS
2323
be treated as an attribute.
2424

2525

26+
SEE ALSO
27+
--------
28+
gitlink:gitattributes[5].
29+
30+
2631
Author
2732
------
2833
Written by Junio C Hamano <junkio@cox.net>

Documentation/git-merge.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ After seeing a conflict, you can do two things:
163163

164164
SEE ALSO
165165
--------
166-
gitlink:git-fmt-merge-msg[1], gitlink:git-pull[1]
166+
gitlink:git-fmt-merge-msg[1], gitlink:git-pull[1],
167+
gitlink:gitattributes[5]
167168

168169

169170
Author

Documentation/gitattributes.txt

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,12 +322,43 @@ String::
322322
requested with "binary".
323323

324324

325+
Built-in merge drivers
326+
^^^^^^^^^^^^^^^^^^^^^^
327+
328+
There are a few built-in low-level merge drivers defined that
329+
can be asked for via the `merge` attribute.
330+
331+
text::
332+
333+
Usual 3-way file level merge for text files. Conflicted
334+
regions are marked with conflict markers `<<<<<<<`,
335+
`=======` and `>>>>>>>`. The version from your branch
336+
appears before the `=======` marker, and the version
337+
from the merged branch appears after the `=======`
338+
marker.
339+
340+
binary::
341+
342+
Keep the version from your branch in the work tree, but
343+
leave the path in the conflicted state for the user to
344+
sort out.
345+
346+
union::
347+
348+
Run 3-way file level merge for text files, but take
349+
lines from both versions, instead of leaving conflict
350+
markers. This tends to leave the added lines in the
351+
resulting file in random order and the user should
352+
verify the result. Do not use this if you do not
353+
understand the implications.
354+
355+
325356
Defining a custom merge driver
326357
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
327358

328-
The definition of a merge driver is done in `gitconfig` not
329-
`gitattributes` file, so strictly speaking this manual page is a
330-
wrong place to talk about it. However...
359+
The definition of a merge driver is done in the `.git/config`
360+
file, not in the `gitattributes` file, so strictly speaking this
361+
manual page is a wrong place to talk about it. However...
331362

332363
To define a custom merge driver `filfre`, add a section to your
333364
`$GIT_DIR/config` file (or `$HOME/.gitconfig` file) like this:

0 commit comments

Comments
 (0)