Deleting the .git
folder may cause problems.
If we want to delete all of our commits history, but keep the code in its current state:
# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH
# Add all the files:
git add -A
# Commit the changes:
git commit -am "Initial commit"
# Delete the old branch:
git branch -D master
# Rename the temporary branch to master:
git branch -m master
# Finally, force update to our repository:
git push -f origin master
NOTE: You need to provide your GitHub account credentials.
Reset tracked files [git docs](https://git-scm.com/docs)
# Update or remove previously tracked files from the entire working tree (it will not add new files).
git add -u
# Reset current HEAD to the specified state
git reset -- <file | folder>