Skip to content

Instantly share code, notes, and snippets.

@moskrc
Last active March 30, 2023 10:19
Show Gist options
  • Save moskrc/d79adbe33bf7fa90adbdaa6db928f2bd to your computer and use it in GitHub Desktop.
Save moskrc/d79adbe33bf7fa90adbdaa6db928f2bd to your computer and use it in GitHub Desktop.
Squash all commits in a branch
git switch yourBranch
git reset --soft $(git merge-base main HEAD)
git commit -m "one commit on yourBranch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment