Nick Vanderbilt
Nick Vanderbilt

Reputation: 38450

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 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.

Upvotes: 4

Views: 492

Answers (1)

CB Bailey
CB Bailey

Reputation: 791789

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.

Upvotes: 6

Related Questions