.git folder and can I delete it

git

I used DaisyDisk to get info about my drive. I found a folder named ".git" in my documents. Its size is about 15 GB. what is it? and can I delete it?

Best Answer

Git is a version control system and stores the history in a subdirectory .git

That is a way of keeping copies of snapshots source code or other documents in a way so that you can go to the complete set of documents at an earlier given time and/or see when and who changed a file and what change was made.

A version control system can be used just for your documents or put in a shared place so people who collaborate all can see and make changes.

You can use tools like SourceTree to view what is in your history.

Thus is you are not using git you can delete the .git directory but I would ask how did it get there. It is possible that another application could use git, I would see if any of your apps say they keep old copies of data however I would hope that they would not do this for all of ~/Documents as this would mess up other peoples' use of this directory. The actual directory .git is in would help to identify the application using it.