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?
.git folder and can I delete it
git
Related Question
- Git – Is It Normal to Have the Home Directory Under Git?
- Executing commands in PS1 on macOS Sierra not working
- MacOS – How to update Git (actually remove apple git and install new one via brew)
- MacOS – How to get p4merge to come up when I do git mergetool and not filemerge
- MacOS – How to install Git Extension on MacOS
- MacOS – Unexpected question ‘enter PIN for “Kryptonite iOS”’ while doing git pull after updating to MacOS Catalina 10.15.4
- Homebrew Git – Unable to Install Git Using Homebrew
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.