Last active
January 3, 2022 16:33
-
-
Save dcasati/33f4a807784d8afa9c15b8c0884c0e45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use these steps to clear out Github's commit history. | |
# Useful when moving a repo from private to public | |
git checkout --orphan newBranch | |
git add -A # Add all files and commit them | |
git commit | |
git branch -D main # Deletes the main branch | |
git branch -m main # Rename the current branch to main | |
git push -f origin main # Force push master branch to github | |
git gc --aggressive --prune=all # remove the old files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment