'\" t .\" Title: git-merge-file .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 01/05/2024 .\" Manual: Git Manual .\" Source: Git 2.43.0.381.gb435a96ce8 .\" Language: English .\" .TH "GIT\-MERGE\-FILE" "1" "01/05/2024" "Git 2\&.43\&.0\&.381\&.gb435a9" "Git Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" git-merge-file \- Run a three\-way file merge .SH "SYNOPSIS" .sp .nf \fIgit merge\-file\fR [\-L [\-L [\-L ]]] [\-\-ours|\-\-theirs|\-\-union] [\-p|\-\-stdout] [\-q|\-\-quiet] [\-\-marker\-size=] [\-\-[no\-]diff3] [\-\-object\-id] .fi .sp .SH "DESCRIPTION" .sp Given three files \fB\fR, \fB\fR and \fB\fR, \fIgit merge\-file\fR incorporates all changes that lead from \fB\fR to \fB\fR into \fB\fR\&. The result ordinarily goes into \fB\fR\&. \fIgit merge\-file\fR is useful for combining separate changes to an original\&. Suppose \fB\fR is the original, and both \fB\fR and \fB\fR are modifications of \fB\fR, then \fIgit merge\-file\fR combines both changes\&. .sp A conflict occurs if both \fB\fR and \fB\fR have changes in a common segment of lines\&. If a conflict is found, \fIgit merge\-file\fR normally outputs a warning and brackets the conflict with lines containing <<<<<<< and >>>>>>> markers\&. A typical conflict will look like this: .sp .if n \{\ .RS 4 .\} .nf <<<<<<< A lines in file A ======= lines in file B >>>>>>> B .fi .if n \{\ .RE .\} .sp If there are conflicts, the user should edit the result and delete one of the alternatives\&. When \fB\-\-ours\fR, \fB\-\-theirs\fR, or \fB\-\-union\fR option is in effect, however, these conflicts are resolved favouring lines from \fB\fR, lines from \fB\fR, or lines from both respectively\&. The length of the conflict markers can be given with the \fB\-\-marker\-size\fR option\&. .sp If \fB\-\-object\-id\fR is specified, exactly the same behavior occurs, except that instead of specifying what to merge as files, it is specified as a list of object IDs referring to blobs\&. .sp The exit value of this program is negative on error, and the number of conflicts otherwise (truncated to 127 if there are more than that many conflicts)\&. If the merge was clean, the exit value is 0\&. .sp \fIgit merge\-file\fR is designed to be a minimal clone of RCS \fImerge\fR; that is, it implements all of RCS \fImerge\fR\*(Aqs functionality which is needed by \fBgit\fR(1)\&. .SH "OPTIONS" .PP \-\-object\-id .RS 4 Specify the contents to merge as blobs in the current repository instead of files\&. In this case, the operation must take place within a valid repository\&. .sp If the \fB\-p\fR option is specified, the merged file (including conflicts, if any) goes to standard output as normal; otherwise, the merged file is written to the object store and the object ID of its blob is written to standard output\&. .RE .PP \-L