Skip to content

Instantly share code, notes, and snippets.

View piraka9011's full-sized avatar
🍍

Anas Abou Allaban piraka9011

🍍
View GitHub Profile
@piraka9011
piraka9011 / how-to-squash-commits-in-git.md
Created October 21, 2019 15:30 — forked from patik/how-to-squash-commits-in-git.md
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

Keybase proof

I hereby claim:

  • I am piraka9011 on github.
  • I am anas9011 (https://keybase.io/anas9011) on keybase.
  • I have a public key ASBLGr_u2a5g4MlUaPfS835crKpGOAQENQLV0UlsVqjYcQo

To claim this, I am signing this object: