【问题标题】:Pull git contents without the meta content拉取没有元内容的 git 内容
【发布时间】:2015-09-25 12:21:30
【问题描述】:

示例: Git Repository abc.git 包含跟踪文件 abc-home.txt 和 abc-artifact.img

当我执行 git clone 时,我会得到文件,然后 git 会创建一个包含元信息的 .git 目录。 我可以要求 git 只给我没有元信息的文件吗?

澄清编辑:我正在从远程裸仓库中提取。

【问题讨论】:

标签: git


【解决方案1】:

您可以使用git archive 并立即使用tar 提取它:

git archive <branch-name> | tar -xC ./extract-here

或者,如果您对存档没问题,您可以创建存储库的 zip:

git archive --format zip --output <repository.zip> <branch-name>

如果您在本地没有存储库的克隆,只需将选项 --remote=<repository-url> 添加到 git archive 命令即可。

【讨论】:

    猜你喜欢
    • 2013-03-27
    • 1970-01-01
    • 1970-01-01
    • 2016-04-23
    • 2021-03-04
    • 2023-01-04
    • 1970-01-01
    • 2023-03-07
    • 1970-01-01
    相关资源
    最近更新 更多