Skip to main content
  1. Learn center
  2. Software Development
  3. Guides
  4. Git tutorial
  5. Git basics
  6. Managing Git history
  7. Merging commits
GuidesSoftware DevelopmentBacklog
Git

Project and code management together.

Merging commits

Squashing is the process of merging multiple commits into a single commit.

If you run the git merge command and the --squash option, a new commit will group all of the commits from a branch together. That commit can then merge into the current branch.

Diagram using the squash command.
Use git merge --squash to unify commits from a feature/topic branch into a single commit to be merged into your current branch.

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life