Skip to content

Instantly share code, notes, and snippets.

@salyh
Created January 18, 2024 10:18
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 salyh/d63a4828364f3313837f12939a3b57a4 to your computer and use it in GitHub Desktop.
Save salyh/d63a4828364f3313837f12939a3b57a4 to your computer and use it in GitHub Desktop.
git: squash all commits in the current branch
git reset --soft HEAD~$(( $(git rev-list --count $(git rev-parse --abbrev-ref HEAD)) -1 )) && git commit -m "Initial commit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment