2

So this is the thing: I've got a process that should download files from git remote repository and deploy them onto destination server which does not have a git installed on.

In addition, I should be able to download the files based on a given git tag and only the HEAD.

What is the best way to such thing?

4

1 回答 1

3

为了实现 git 远程 repo 内容和目标之间的简单复制,您可以考虑使用git archive.
请参阅“本周 Git 提示:Git 存档

使用 Git 而不是命令行工具执行存档的一个关键优势是避免意外捕获(大).git 目录或任何正在进行的内容。例如,如果您刚刚运行了构建,那么 zip (tar) 也将包含构建输出的内容。

另一个优点是您可以在任意版本中提取存储库的内容。

另外,通过网络复制一个文件比 rsync 大量文件更不容易出错。

于 2012-06-05T06:35:50.773 回答