Skip to content

Instantly share code, notes, and snippets.

@changbowen
Last active October 28, 2019 03:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save changbowen/7e3fe4d90290cef6cdadb9af9de7eb63 to your computer and use it in GitHub Desktop.
Save changbowen/7e3fe4d90290cef6cdadb9af9de7eb63 to your computer and use it in GitHub Desktop.
git checkout --orphan latest_branch # orphan omits all the history
git add * # if you want to include all files (respecting gitignore). Otherwise make other changes here.
git commit -am "commit message"
git branch -D master # delete master branch
git branch -m master # rename current branch to master
git push -f origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment