On a Mac used for Unity development, it's all svn, but there's only one folder used with a server git repo, /User/myname/clients/blah/project
Now I happened to be using Android Studio and (like most IDEs now) it tries to do source control for you. I got a pop up alerting me there is an "unregistered source", in fact at my home folder.
So at /User/myname I found these files ..
$ ls -la
$ ls -la
$ git log
fatal: your current branch 'master' does not have any commits yet
.gitdirectory in your home folder
It is not required.
I'm using git heavily and git didn't create that directory on my machine. Before deleting it, I would recommend you to look whats inside the git repository, by executing
git log. If it's empty, it is safe to delete it. If it's not empty, you can create a new clone by doing
git clone $HOME/.git strangerepo. Then, look at the folder
strangerepo to see the content of the git repo.
EDIT: Keep in mind that the working directory is relevant when executing the git command. If git is not currently inside a git repository, it will go to the parent directory and search for a
.git folder there. When it reaches
/, it will output an error that no repository was found. So executing
git log in
$HOME will have a different result than running it in
Don't delete it. Git uses it.
To use git, you need to tell git your name and your email. You do so with commands that look like that:
git config --global what.ever value
These config is saved in
$HOME/.gitconfig. If you call
git config without the
--global flag (inside a git repo directory), git will only save the config for the specific repository. But of course this file does not need to contain your password - a file looking like this is just fine:
[user] email = email@example.com name= XYZ