GitHub Squash commits on your branch

niharikapujari

Niharika Pujari

Posted on April 2, 2020

GitHub Squash commits on your branch

Squash all your commits on a branch?

  • Get a complete history of commits by running:

Alt Text

  • Now, run the below command to squash the commits on your branch, Number of commits = commits you would like to squash.

Alt Text

  • After you run the previous command you now need to pick the commits you would like to squash, personally I use f to pick the commits. So instead of pick INSERT f (replace pick with f) expect for the first commit.

Alt Text

ESC, :x to exit VIM.

  • Verify in git log and your commits should be squashed.
💖 💪 🙅 🚩
niharikapujari
Niharika Pujari

Posted on April 2, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related