Next: , Previous: , Up: Manipulating   [Contents][Index]


6.6 Merging

Also see the git-merge(1) manpage. For information on how to resolve merge conflicts see the next section.

m     (magit-merge)

This transient prefix command binds the following suffix commands along with the appropriate infix arguments and displays them in a temporary buffer until a suffix is invoked.

When no merge is in progress, then the transient features the following suffix commands.

m m     (magit-merge-plain)

This command merges another branch or an arbitrary revision into the current branch. The branch or revision to be merged is read in the minibuffer and defaults to the branch at point.

Unless there are conflicts or a prefix argument is used, then the resulting merge commit uses a generic commit message, and the user does not get a chance to inspect or change it before the commit is created. With a prefix argument this does not actually create the merge commit, which makes it possible to inspect how conflicts were resolved and to adjust the commit message.

m e     (magit-merge-editmsg)

This command merges another branch or an arbitrary revision into the current branch and opens a commit message buffer, so that the user can make adjustments. The commit is not actually created until the user finishes with C-c C-c.

m n     (magit-merge-nocommit)

This command merges another branch or an arbitrary revision into the current branch, but does not actually create the merge commit. The user can then further adjust the merge, even when automatic conflict resolution succeeded and/or adjust the commit message.

m a     (magit-merge-absorb)

This command merges another local branch into the current branch and then removes the former.

Before the source branch is merged, it is first force pushed to its push-remote, provided the respective remote branch already exists. This ensures that the respective pull-request (if any) won’t get stuck on some obsolete version of the commits that are being merged. Finally, if magit-branch-pull-request was used to create the merged branch, then the respective remote branch is also removed.

m i     (magit-merge-into)

This command merges the current branch into another local branch and then removes the former. The latter becomes the new current branch.

Before the source branch is merged, it is first force pushed to its push-remote, provided the respective remote branch already exists. This ensures that the respective pull-request (if any) won’t get stuck on some obsolete version of the commits that are being merged. Finally, if magit-branch-pull-request was used to create the merged branch, then the respective remote branch is also removed.

m s     (magit-merge-squash)

This command squashes the changes introduced by another branch or an arbitrary revision into the current branch. This only applies the changes made by the squashed commits. No information is preserved that would allow creating an actual merge commit. Instead of this command you should probably use a command from the apply transient.

m p     (magit-merge-preview)

This command shows a preview of merging another branch or an arbitrary revision into the current branch.

When a merge is in progress, then the transient instead features the following suffix commands.

m m     (magit-merge)

After the user resolved conflicts, this command proceeds with the merge. If some conflicts weren’t resolved, then this command fails.

m a     (magit-merge-abort)

This command aborts the current merge operation.


Next: , Previous: , Up: Manipulating   [Contents][Index]