Why should a remote git server have --bare

I am reading these two articles . However, I still don't get the -bare option. If the server does not have a working directory, and if a new member of the team clones the project, then this person will not receive any content.

Any further clarification will help in deciding why -bare is necessary.

+4
source share
1 answer

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

In any case, they will receive a full copy of the remote repository objects, and in the initial clone, a local branch will be configured to track the default branch of the remote repository (usually this is a wizard), and this local branch will be checked.

It is usually recommended that the remote repository be exposed, since an attempt to click on a marked branch will cause the remote working tree to no longer synchronize with the selected branch. Usually for a remote repository there is usually no working tree.

+6
source

Source: https://habr.com/ru/post/1305453/


All Articles