Search code examples
gitrepository

How delete all repository history while keeping the changes?


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.


Solution

  • 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