Why remote git server should have --bare
I am reading these two articles. However I still do not get --bare option. If the server has no work开发者_如何转开发ing 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.
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.
精彩评论