LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

git-merge-into

Merge current branch into target

TLDR

Merge current branch into target
$ git merge-into [target-branch]
copy
Merge current branch into main
$ git merge-into main
copy
Merge the specified source into the target
$ git merge-into [source-branch] [target-branch]
copy

SYNOPSIS

git merge-into [source-branch] target-branch [--ff-only]

DESCRIPTION

git merge-into merges the current (or specified) branch into another branch without manually switching contexts. It reverses the normal merge workflow, where one would first checkout the target branch, perform the merge, then switch back.The command checks out the target, performs the merge, then returns to the original branch automatically. This saves the repetitive workflow of switching branches for a simple merge operation.

PARAMETERS

SOURCE-BRANCH

Optional branch to merge (defaults to the current branch).
TARGET-BRANCH
Branch that will receive the merge.
--ff-only
Refuse the merge unless it can be resolved as a fast-forward.
--help
Display help information.

CAVEATS

Part of git-extras package. Requires clean working directory. Conflicts may leave you on target branch.

HISTORY

git merge-into is part of git-extras, providing a convenience command for the reversed merge workflow.

SEE ALSO

Copied to clipboard
Kai