为什么远程git服务器应该有--bare [英] Why remote git server should have --bare

查看:134
本文介绍了为什么远程git服务器应该有--bare的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读这些两个 文章。不过,我仍然没有得到 - 无选择权。如果服务器没有工作目录,并且团队的新成员克隆项目,那么该人将不会获得任何内容。

任何进一步的澄清将有助于解释为什么 - 需要。

解决方案

无论服务器是否有工作树,都不会影响直接克隆远程存储库的客户端。 b
$ b在任何一种情况下,它们都会获得远程存储库对象的完整副本,并且在初始克隆上,将设置本地分支以跟踪远程存储库的默认分支(通常是主分支),而此本地分支将被签出。



通常建议将远程存储库作为裸机,因为试图推送到检出的分支会导致远程的工作树与检出分支不同步。远程仓库通常不需要有工作树。


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.

解决方案

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.

这篇关于为什么远程git服务器应该有--bare的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆