How delete all repository history while keeping the changes?

Viewed 37

The file of my repository is very large. I am sure that I don't want to revert any previous commit, meaning all changes that have been done are wanted to be kept for good in the code. I just want to delete all the previous history while keeping the changes in place.

1 Answers

You can just delete the .git folder and then reinitialize the repo with git init.

On Windows, this can be done with rmdir /s .git

Related