8

I have accidentally put my home folder under git version control. How can I undo this? I am running Ubuntu 16.04.

Interestingly, running

$ git status

Informs me that the Mozilla Firefox cache has been altered.

Screenshot of terminal


Related questions:

salehgeek
  • 91
  • 1
  • 1
  • 7

3 Answers3

23

Try removing the .git directory and .gitignore if exist: rm -Rf .git .gitignore

Daniel Pérez
  • 1,873
  • 1
  • 17
  • 25
  • Entering _ls_ into the terminal didn't show _.git_ or _.gitignore_, but running rm -Rf .git .gitignore solved the problem. – salehgeek Jun 02 '17 at 20:57
  • @salehgeek That is because `ls` doesn't show hidden files by default. you would have better luck with `ls -A` or `ls -a` (the latter also shows the current and top directories as '.' and '..') – Douwe van der Leest Mar 10 '20 at 10:43
4

You can just remove the .git folder from your homedir.

Mureinik
  • 297,002
  • 52
  • 306
  • 350
3

The shorted command should be

rm -Rf .git*

EDIT:

You must remove only .git folder. Your home's .gitignore file is used by git to automatically ignore files. For example, ... instead of put .idea (an editor dot file) in all your project, you can just add it once in your global gitignore.

Tecnically

rm -rf .git*

delete also this .gitignore file.

sensorario
  • 20,262
  • 30
  • 97
  • 159