I accidentally typed git init in my home directory which caused git to start tracking everything in my home directory and I need to remove it.

Is there a git command or a way to terminate git tracking everything in my home directory?



Git creates a folder .git in the top-level directory it tracks. The only thing you need to do is to remove that folder using rm -Rf .git.

  • Thanks a million Jan! Nothing complicated, just as I like it. – Antoin Stanton Oct 9 '15 at 11:24
  • 1
    It's worth noting that without additional commands, git init won't track any changes—it will just save the state of the directory at the time git init was run. If you later added and then deleted a file, git wouldn't know about that file. (If privacy/security is a concern.) – Wildcard Oct 27 '15 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.