Skip to content

Instantly share code, notes, and snippets.

@samdark
Created June 29, 2014 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samdark/54764dd69b3e38140938 to your computer and use it in GitHub Desktop.
Save samdark/54764dd69b3e38140938 to your computer and use it in GitHub Desktop.
Git: squash last 3 commits together
git reset --soft HEAD~3
git commit -m 'new commit message'
@Hser2bio
Copy link

thanks sir

i was looking for that

@wzab
Copy link

wzab commented Feb 18, 2021

It seems that git reset --soft HEAD~3 squashes last 4 commits, not last 3!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment