Somehow I made my home directory (~) a git repository.

git status returns all of the files in my directory, which I do not want to commit.

git rm --cached -r * is not what I want either.

How can I remove the repository without deleting all of the files?

  • Sounds like it iis time to go back to your trusty backup you made before embarking on such a large project.
    – SDsolar
    Commented Feb 21, 2017 at 0:58
  • Yes. Who knew I could code so quickly! Commented Feb 21, 2017 at 2:52

2 Answers 2


Remove the .git directory from ~/.

  • 1
    rm -rf .git/ it is! Commented Feb 18, 2017 at 19:32

So, I did the same thing where every time I ran it returned the whole directory listed within /User/ and I made the mistake of running git clean -f -d on it yesterday but lo and behold, I deleted ALL my files!

Anyway, just a heads up to anyone who has this issue: rm -rf .git/ when ran inside ~/ worked for me and I can now stop pulling my hair out about it.

Be careful with git clean -- and if in doubt, talk to someone.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .