Subcommands (5)
git merge-base
→Find a common ancestor of two commits.
git merge-index
→Run a merge program on files that need merging.
git merge-into
→Merge one branch into another branch. Part of `git-extras`.
git merge-repo
→Merge two repository histories. Part of `git-extras`.
git merge-tree
→Merge branches without changing files.
Options (3)
-e, --editbooleanEdit the merge message
Example:
git merge {{[-e|--edit]}} {{branch_name}}-s, --strategybooleanMerge using a specific strategy
Example:
git merge {{[-s|--strategy]}} {{strategy}} {{[-X|--strategy-option]}} {{strategy_option}} {{branch_name}}-X, --strategy-optionbooleanMerge using a specific strategy
Example:
git merge {{[-s|--strategy]}} {{strategy}} {{[-X|--strategy-option]}} {{strategy_option}} {{branch_name}}Examples (6)
Merge a branch into your current branch
git merge branch_nameEdit the merge message
git merge [-e|--edit] branch_nameMerge a branch and create a merge commit
git merge --no-ff branch_nameCopy the state of a branch into the working tree and stage it (Note: Use `git commit` to create the actual commit)
git merge --squash branch_nameAbort a merge in case of conflicts
git merge --abortMerge using a specific strategy
git merge [-s|--strategy] strategy [-X|--strategy-option] strategy_option branch_namemade by @shridhargupta | data from tldr-pages