tags:

views:

79

answers:

1

I am reading these two articles. However I still do not get --bare option. If the server has no working directory and if a new member of the team clones the project then that person will not get any content.

Any further clarification will help on why --bare is needed.

+5  A: 

Whether or not the server has a working tree does not affect clients who directly clone the remote repository.

In either case they will get a full copy of the remote repository's objects and, on initial clone, a local branch will be set up to track the remote repository's default branch (usually master) and this local branch will be checked out.

It is usually recommended that the remote repository be made bare as attempting to push to a branch which is checked out would cause the remote's working tree to become out of sync with its checked out branch. It is usually not necessary for the remote repository to have a working tree.

Charles Bailey
If the remote server does not have my foo.txt then after I clone the bare repository then I don't have foo.txt. All I have is a directory called .git. Now how do I get foo.txt ?
Nadal
Are you using --bare when you're cloning? If so, you should not. Either way, you can do git checkout to get foo.txt.
Andreas
@dorelal: So long as your remote repository has a valid `HEAD` reference, when you clone it will checkout a new branch based on the default remote branch. If this branch contains a file `foo.txt`, then so will the working tree of the new clone. If this doesn't work for you then you need to give more information about your set up and what error messages you are getting.
Charles Bailey
I am not getting any error. I am just reading up on git and came to know about --bare option. I guess I should give it a try to fully understand it. thanks guys.
Nadal