Skip to content

Instantly share code, notes, and snippets.

@Chocobo1
Last active March 16, 2017 06:25
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 Chocobo1/5a11e9d935bb5578435ed98cacb9208f to your computer and use it in GitHub Desktop.
Save Chocobo1/5a11e9d935bb5578435ed98cacb9208f to your computer and use it in GitHub Desktop.
Reset Git history
#!/bin/sh
# from: http://stackoverflow.com/a/13102849
git checkout --orphan newMaster
git add -A # Add all files and commit them
git commit -m "Initial commit"
git branch -D master # Deletes the master branch
git branch -m master # Rename the current branch to master
#git push -f origin master # Force push master branch to github
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment