如何使用 git-archive 从裸存储库中包含子模块 [英] How can I use git-archive to include submodules from a bare repository

查看:16
本文介绍了如何使用 git-archive 从裸存储库中包含子模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设置部署脚本.基本流程是:

I'm in the process of setting up a deployment script. The basic process is:

  1. 将更改推送到服务器上的裸仓库
  2. 然后根据新标签为发布创建一个新文件夹.
  3. 使用 git archive 将文件移动到发布目录
  4. 运行一些迁移脚本并使其生效(如果一切成功).

问题是我的存储库包含一个子模块,该子模块未放入存档中,因此未放入发布目录中.

The issue is my repository contains a submodule, which doesn't get put in the archive, and therefore doesn't get put in the release directory.

我见过 git-archive-all,但这在裸机上不起作用存储库.

I've seen git-archive-all, but that doesn't work on a bare repository.

如果不可能,我正在考虑,

If its not possible, I'm considering,

  1. 使存储库不是空的,并更新工作副本,这将允许我使用 git-archive-all.或者
  2. 在服务器上有第二个子模块的裸存储库,我可以从中获取存档(必须查看此内容以确保我获得正确的修订版).

推荐答案

我使用这个 python 包 https://github.com/Kentzo/git-archive-all.您可以使用

I use this python package https://github.com/Kentzo/git-archive-all. You can install it by using

pip install git-archive-all

在 OSX 上,您也可以使用 brew install git-archive-all

On OSX, you can install it also using brew install git-archive-all

这篇关于如何使用 git-archive 从裸存储库中包含子模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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