Skip to content

Instantly share code, notes, and snippets.

View RifatMahmudno-1's full-sized avatar
🏠
Working from home

Rifat Mahmud RifatMahmudno-1

🏠
Working from home
View GitHub Profile
@RifatMahmudno-1
RifatMahmudno-1 / repo-reset.md
Created July 27, 2021 17:26 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

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