Search code examples
gitgit-clone

Where does the file <project>.git come from?


I've initialized several local git repos but none of them have a <project>.git file; only a .git directory. I would like to clone one of these repos to another machine on the local network, but clone seems to require a <project>.git file. How does this file get generated?


Solution

  • To have a project.git (and not a project/.git), you would need to use git clone --bare or git init --bare.

    That would create a bare repository, one with only the .git content and no working tree.