Skip to content

Instantly share code, notes, and snippets.

@pqt
Created March 26, 2020 03:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pqt/f42bf93129f4af6904fe38fc75579146 to your computer and use it in GitHub Desktop.
Save pqt/f42bf93129f4af6904fe38fc75579146 to your computer and use it in GitHub Desktop.
Are you about to open-source a private repository? Do you want to squash all history into a single commit before making the code public? This one-liner takes care of it
# Modified slightly from https://twitter.com/mathias/status/1045312837671882752
git reset $(git commit-tree HEAD^{tree} -m 'first commit')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment