git init will not create git directories for me

On Windows, git init may create a hidden .git folder. Go to Organize --> Files and Search Options --> and then check Show Hidden Files. That will unveil the .git folder.


Except if you have used the --git-dir option when running "git init", your .git directory MUST be in the directory. Perhaps you should look more carefully.

In the same idea, perhaps have you set an environment variable GIT_DIR that change the place where the .git directory is stored. See http://git-scm.com/docs/git-init Remove this env variable if it's the case.

And the added (staged) files are stored in the index file stored inside this .git directory...

dir -AH (in powershell? otherwise it's dir /AH) works well for me...


A git init myrepo would always create an empty myrepo/ folder, with the myrepo/.git in it ready to get data.

A git init --bare myrepo.git is for creating a bare repo you can push to:

cd myrepo
git remote add origin ../myrepo.git
touch file.txt
git add .
git commit -m "First commit"
git push -u origin master

http://www.ossxp.com/doc/gotgit-en/images/en/fig-13-03-git-clone-2.png

(Picture from gotgit)

You wouldn't see file.txt on myrepo.git upstream repo though, since a bare repo has no working tree (hence "bare")

In the repo, myrepo/.git/objects would contain the objects you are adding to the local repo: see Git Internals - Git Objects.
From gotgit:

http://www.ossxp.com/doc/gotgit-en/images/en/fig-06-02-git-repos-detail.png

Tags:

Git

Git Init