gitgit-init

git init will not create git directories for me


I am new to Git. I can get a Git directory structure in a bare directory with git -init --bare. I can see where the git information is stored.

However, when I try to use git init or even git clone, I never see any .git subdirectory in my local repository. I can add files and push, but have no idea where those files are actually stored on disk for my local repository.

From the documentation:

$ git init

This creates a new subdirectory named .git that contains all of your necessary repository files – a Git repository skeleton.

However, I never see that skeleton directory. I have used dir -AH to see if the git directory is hidden, but there is none. Why do I not get a git skeleton directory? And where, exactly are the added (staged) files put?


Solution

  • 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...