Skip to content

Instantly share code, notes, and snippets.

Daltonic

Block or report user

Report or block Daltonic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@heiswayi
heiswayi / repo-reset.md
Created Feb 5, 2017
GitHub - Delete commits history with git commands
View repo-reset.md

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
You can’t perform that action at this time.