Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This post says

in a bar Git repository, there is no working copy and the folder (let's call it repo.git) contains the actual repository data

however after experiment,I found it's not true.

There's still .git directory in a bare repository.

So what's the difference at all?

share|improve this question

closed as off topic by Zoredache, Iain, Ward, RobM, womble Aug 15 '11 at 11:22

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers 2

Reiterating...

A standard git repository is a working copy with the git data stored in the .git directory.

A bare git repository does not have a working copy, and is in essence only the .git directory (but is not named .git, it's named whatever you called it).

That post you found is exactly correct.

share|improve this answer

Just tested this. No directory named .git is present in a bare repository.

~/test$ git --bare init
Initialized empty Git repository in /home/user/test/
~/test$ ls -a
.  ..  HEAD  branches  config  description  hooks  info  objects  refs

If you have one, then your bare repository isn't actually a bare repository. What steps are you taking to create or clone your repository?

share|improve this answer
1  
This isn't quite correct. See my answer. –  bahamat Aug 15 '11 at 4:20
    
@bahamat I am aware that a bare repo is equivalent to the contents of the .git directory of a normal repo. I meant, in the quite literal sense, that a bare repo doesn't contain a directory named .git. He's got one, which is why I asked how he's creating his clone. –  Shane Madden Aug 15 '11 at 5:22
    
@bahamat After a re-read, I can see why you felt the need to clarify. I've edited to make the aspects of the answer less opaque. Thanks, and +1 to your answer. –  Shane Madden Aug 15 '11 at 6:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.