Skip to content

Instantly share code, notes, and snippets.

@jagroop jagroop/
Last active Dec 13, 2017

What would you like to do?
Delete git history

git checkout --orphan latest_branch # Checkout
git add -A # Add all the files
git commit -am "first commit" # Commit the changes
git branch -D master # Delete the branch
git branch -m master # Rename the current branch to master
git push -f origin master # Finally, force update your repository

Short Hand :

git checkout --orphan latest_branch && git add -A && git commit -am "first commit" && git branch -D master && git branch -m master && git push -f origin master
published: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.