git-merge-into(1)

git-merge-into1

Merge one branch into another

Usage

git merge-into [src] <dest> [--ff-only]

Overview

Merge one branch into another, and keep yourself on current branch. If src branch not given, it will merge current one to dest.

Options

<src>

The name of the branch will be merged into. If this not given, use current branch as default.

<dest>

The name of the branch to merge into.

--ff-only

Refuse to merge and exit with a non-zero status unless the current HEAD is already up-to-date or the merge can be resolved as a fast-forward.

Examples

Assume the following history exists and the current branch is src:

                 A---B---C src(current)
                /
           D---E---F---G dest

After running git merge-into dest, it will look like this:

                A---B---C src(current)
                /         \
           D---E---F---G---H dest

The H commit will record the merge result, just like what git merge does. And src is still the current branch.

The default implementation of merge-into use git checkout and git merge, which may cause temporary change in the working tree. If you make sure your branch can be merged fast-forward, add --ff-only to avoid files change.

Releases

5 releases since Debian 9 (Stretch); the text changed 4 times.

  1. 9
  2. 10
  3. 11
  4. 12
  5. 13

Author

Written by spacewander <[email protected]>

Reporting bugs

<https://github.com/tj/git-extras/issues>

From git-extras 7.3.0-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.