Git : How to get a snapshot of a git repository

大憨熊 提交于 2019-11-30 10:56:42

问题


I'm looking for the right way to get an archive of a git repository without the .git/ directory in order to send a daily snapshot to testers.


回答1:


git archive HEAD --format=zip > archive.zip

This does what it says on the tin.

More info here: http://gitready.com/intermediate/2009/01/29/exporting-your-repository.html




回答2:


This will result in archive.tar.gz and add a prefix dir named "prefix-dir":

git archive --prefix=prefix-dir/ -o archive.tar HEAD
gzip archive.tar


来源:https://stackoverflow.com/questions/615816/git-how-to-get-a-snapshot-of-a-git-repository

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!