ambe5960
ambe5960

Reputation: 2000

Where are the files in a bare repository?

So, I cloned a project to a bare repository on a remote server thinking I could use that as the remote file structure which to run my site off. Running git clone --bare http://github.com/myproject only created a directory called myproject.git.

I get some of the functions of a bare repository, but where is the file structure of my project within it?

If it can be used to run code off of (I may be incorrect in this assumption), then I need somewhere to point to as my webserver document root.

At present, I cannot find any of my files within the bare repository.

Upvotes: 5

Views: 4002

Answers (2)

perror
perror

Reputation: 7426

They are stored as "blobs" in the .git/ directory and they are totally unreachable as "files".

To get a visible version of your project, you should clone it and extract it from the bare repository.

In fact, the first usage of the bare repository is to have it on servers which is a place where it is quite unlikely that a user will come and start using the files.

Upvotes: 15

Joseph K. Strauss
Joseph K. Strauss

Reputation: 4913

Bare repositories are "bare", quite surprisingly :-) This means that they are "empty", and do not have a checked out file structure. (There are files that record git history, though.)

That being said, in later versions of Git, (2.5+) you can always add another worktree. This works with bare repositories as well. See the documentation for more information.

Upvotes: 5

Related Questions