Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
git守护进程在哪里存储文件_Git - Fatal编程技术网

git守护进程在哪里存储文件

git守护进程在哪里存储文件,git,Git,我正在Centos5机器上工作,在那里我使用命令创建了空的裸存储库 $ mkdir test_repo.git $ cd test_repo.git $ git --bare init $ git daemon --reuseaddr --base-path=/data/test_work/ --export-all --verbose --enable=receive-pack $ git clone git://<system_ip where git dameon run>

我正在Centos5机器上工作,在那里我使用命令创建了空的裸存储库

$ mkdir test_repo.git
$ cd test_repo.git
$ git --bare init
$  git daemon --reuseaddr --base-path=/data/test_work/ --export-all --verbose --enable=receive-pack
$ git clone git://<system_ip where git dameon run>/test_repo.git
它只包含git元数据。然后,我使用命令在同一系统上启动git守护进程

$ mkdir test_repo.git
$ cd test_repo.git
$ git --bare init
$  git daemon --reuseaddr --base-path=/data/test_work/ --export-all --verbose --enable=receive-pack
$ git clone git://<system_ip where git dameon run>/test_repo.git
从局域网内的另一台机器上,我克隆了那个空的存储库,添加一些文件,并使用命令将其提交并推送到主机

$ mkdir test_repo.git
$ cd test_repo.git
$ git --bare init
$  git daemon --reuseaddr --base-path=/data/test_work/ --export-all --verbose --enable=receive-pack
$ git clone git://<system_ip where git dameon run>/test_repo.git
然后我从另一台机器上克隆了它,它工作得很好,我得到了我推动的所有更改

但当我在运行git守护进程的机器中看到实际的test_repo.git时。它只包含保存我提交的文件的git元数据


请告诉我git daemon和bare repo的实际数据保存位置?它是在我的机器上还是在任何其他位置?

文件存储在Git object store中,如果它是一个裸repo,则不可见。它们没有签出,没有工作副本,只有数据和元数据,以二进制格式保存以节省空间和提高速度

真正的数据在
objects/pack
目录中


有关更多信息,请参阅。

Git通常使用
.Git
目录来存储元数据。如果您删除了工作目录中除此目录以外的所有内容,您仍然可以使用
git checkout
取回提交的文件

您创建了所谓的裸存储库(选项
--bare
)。它只包含
.git
元数据。它不打算直接用于工作,因此文件只会浪费存储空间,而且当有人更新存储库时,更新这些文件将是徒劳的。此外,如果我们收到多个不同分支的提交,我们还应该签出哪个分支!?!提交和其他git对象专门存储在
objects/
子目录下,从提交SHA1的第一个字母开始(例如,您可以在
objects/ff/ee0ccd6cce082784d515a6321a7afbfdc0dde0目录下的
中找到带有SHA1
ffee0ccd6cce082784d515a6321a7afbfdc0dde0的git对象
)或者在压缩格式的
objects/pack/
目录中(多个对象放在同一个高度压缩的文件中以节省存储空间)

所有内容都存储在提交的裸目录中。除非您这样说,否则不会通过网络将任何内容推送到某个秘密的神秘位置(而且该位置也不是秘密的,而是基于您在命令行中所说的内容,使用直接URL或配置的远程名称,其中
origin
自动定义为您最初克隆的存储库)