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:
# Before start, disable all branch protections related to the manipulated branchs.
# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH