save old git repository versions

浪尽此生 提交于 2019-12-02 04:24:06
KingCrunch

Do a "git export" (like "svn export")?

git checkout [commit sha]
git archive --format zip --output /full/path/to/zipfile.zip master

However, I don't know, why. Usually one use a vcs exactly because it saves every state, so why don't you just tag it and check it out, when you need it?

taiansu

I think tag will help. Every time you like to save all the current files, type something like git tag -a v1.4 -m 'version 1.4'. So once you want those files back, commit or stash changes first, then type git checkout v1.4, the files will rollback to the time you tagged. Check these link for further infomation: how to tag and how to get them back.

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