Skip to content

Instantly share code, notes, and snippets.

View Cdddo's full-sized avatar

Carlos Diosdado Cdddo

  • Hypertectonics
  • Mexico
View GitHub Profile
@Cdddo
Cdddo / repo-reset.md
Last active May 28, 2022 18:23 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

Repo Reset

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

# Commit the files:
git commit -m "Initial commit"