Git Cheatsheet - Quick Git Command Reference

Quick reference for common Git commands. Search, copy, and use Git commands instantly.

Share
Back to Git Cheatsheet

git merge

Merge branches into current branch

Syntax

git merge [options] <branch>

Common Options

OptionDescription
--no-ffNo fast-forward, preserve branch history
--ff-onlyOnly merge if fast-forward
--squashSquash merge without commit
--no-commitMerge without auto-commit
--abortAbort merge
--continueContinue merge after resolving conflicts
-m <msg>Specify merge commit message
--strategy=<strategy>Specify merge strategy
-v, --verboseVerbose output

Examples

git merge feature/login

Merge feature/login into current

git merge --no-ff feature/login

Merge preserving branch history

git merge --abort

Abort ongoing merge

git merge --squash feature/login

Squash all changes into one

Related Commands

Related Tools

More Code & Dev Tools