If you want to remove a Git Init file, e.g. from a cloned GitHub respository, first make sure that you are in the correct directory, you can run the following command inside your terminal:
rm -rf .git
Now when you run git status
, your terminal will tell you:
fatal: Not a git repository (or any of the parent directories): .git
Now you can add your own init file to the repository using git init
, and start working with a clean git history file.