Skip to content

Instantly share code, notes, and snippets.

@samdark
Created June 29, 2014 21:42
Show Gist options
  • Select an option

  • Save samdark/54764dd69b3e38140938 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

thanks sir

i was looking for that

@wzab

wzab commented Feb 18, 2021

Copy link
Copy Markdown

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