Skip to content

Instantly share code, notes, and snippets.

@hajdbo
Created December 26, 2018 18:13
Show Gist options
  • Save hajdbo/be8a3e012f60eb7f98737a09341ec7f4 to your computer and use it in GitHub Desktop.
Save hajdbo/be8a3e012f60eb7f98737a09341ec7f4 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:
git reset $(git commit-tree HEAD^{tree} -m 'Initial commit')
(https://twitter.com/mathias/status/1045312837671882752?s=09)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment