[英]How to unarchive a git repository archive created with $ git archive
我有一些使用$ git archive
工具创建的$ git archive
。
知道如何将这些存档还原到存储库中吗?
git archive
不会存档您的存储库。 它会在存储库中创建一个特定修订版本的tarball存档。 因此,您不能将git archive
的输出转换成它来自的完整存储库,对不起。
您可以使用tar xf <filename>
提取git archive
生成的tarball包含的单个修订版。
根据--format选项的值,您可以使用适当的工具提取它们,例如,对于format = zip,解压缩,对于format = tar,解压tar,对于format = tgz,gzip / tar,等等。
压缩:
# git archive --format zip --output filename.zip my_branch
压缩出来:
# unzip filename.zip
设置您的来源并结帐至分支:
# git checkout -b my_branch origin/my_branch
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.