简体   繁体   English

有没有办法将 Git 历史记录保存到 ZIP 文件中?

[英]Is there any way to save Git history into a ZIP file?

I'm a beginner in using Git as version control.我是使用 Git 作为版本控制的初学者。 I need to compile my Git History and compress it into a ZIP file.我需要编译我的 Git History 并将其压缩成 ZIP 文件。 But I can't seem to find a way to find the physical file that shows Git History.但我似乎找不到找到显示 Git 历史记录的物理文件的方法。 The IDE I've used to develop my project is VS Code.我用来开发项目的 IDE 是 VS Code。

git offers a built in way to get the history of a repository in one single file: git bundle . git提供了一种内置方法,可以在一个文件中获取存储库的历史记录: git bundle Check git help bundle for details.有关详细信息,请查看git help bundle


The complete state of your repo is stored in the hidden .git/ directory in the root directory.存储库的完整 state 存储在根目录中隐藏的.git/目录中。 Archive that directory and you will have a backup of your repo.存档该目录,您将拥有您的存储库的备份。

Note that the content of that directory is basically already zipped, so there isn't much gain (in bytes) to expect from compressing it.请注意,该目录的内容基本上已经被压缩,因此压缩它并没有太大的收益(以字节为单位)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM