Git bare - 备份什么?

发布于 2024-10-09 02:41:19 字数 334 浏览 0 评论 0原文

如果其他地方对此进行了介绍,我很抱歉,但我找不到答案。

我有一个名为 bare.git 的裸存储库,它是从中克隆开发存储库的存储库。一切都运转良好。

我想知道 bare.git 从哪里获取源文件。它们是否作为二进制文件存储在 bare.git 文件结构中?我可以将 bare.git 移动到另一个位置,并且仍然从中克隆存储库,因此源在某种程度上必须是可移植的。或者它是否存储对文件的绝对网络引用?

我想知道这些信息有三个主要原因:

  1. 我们需要知道要备份什么。
  2. 我的老板想知道源代码去了哪里。
  3. 我们需要一个当前的复合版本来进行测试。

I'm sorry if this is covered elsewhere, but I can't find the answer.

I have a bare repo, called bare.git which is the repository from which are cloned the dev repos. It all works well.

I want to know where bare.git gets the source files from. Are they stored as binary files inside the bare.git file structure? I can move bare.git to another location and still clone repos out of it, so the source must, in some way, be portable. Or is it storing absolute network references to the files?

There are three main reasons I want o know this information:

  1. We need to know what to backup.
  2. My boss wants to know where the source code has gone.
  3. We need a current composite version for testing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一页 2024-10-16 02:41:19

您的源文件作为 bare.git 文件结构内索引的一部分存储,这与任何克隆中的 .git 目录中的相同。

因此,最好备份完整的 bare.git。

您可以通过克隆裸存储库来获取当前版本进行测试。

Your source files are stored as a part of the index inside of bare.git file structure, which is same as you have in .git directory in any of your clones.

So, it's best to backup full bare.git.

You may get current version for testing by cloning your bare repo.

凉风有信 2024-10-16 02:41:19

为什么您不备份所有存储库?

请参阅 Git 对象模型Git 如何存储对象

Why would you not backup all of the repo?

See The Git Object Model and How Git Stores Objects.

庆幸我还是我 2024-10-16 02:41:19

备份整个 bare.git 文件夹以免错过,以后您可以随时克隆它。

当您想测试源代码时,您需要克隆它。 使用 Git 管理网站一文向您展示了一种处理该问题的方法: 每次推送到 bare.git 后都会自动检查整个存储库,当然是自动的。此代码是您应该测试的内容(除非您想在推送到 bare.git 之前、在预提交或预接收中执行此操作)。

Backup the whole bare.git folder not to miss out, you could always clone it later.

When you wish to test source code, you need to clone it. The article Using Git to manage a web site shows you one way to deal with the issue by checking out the whole repo after each push to bare.git, automatically of course. This code is what you should test (unless you'd like to do that before pushing to bare.git, in pre-commit or pre-receive.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文