myproject-commit1-67d91ab.zip
myproject-commit2-9283acd.zip
myproject-commit3-c57daa6.zip
...
或者进入目录:
myproject-commit1-67d91ab/
myproject-commit2-9283acd/
myproject-commit3-c57daa6/
我正在考虑类似以下的命令:
git archive --format zip --output myproject-commit3.zip c57daa6
以下内容翻译自如何使用git-archive导出特定提交?,但如何获取所有提交?
注:
the goal is to do an export of all files of each commit, so that I can have access to them even if I don't have
git
on the machinethe answer from How can I export Git change sets from one repository to another via sneaker net (external files)? creates a
.bundle
file, but it seems impossible to access it withoutgit
, so it's not what I'm looking forthis nearly works:
for ((i = 0;; ++i)); do git checkout master~$i || break; tar czf ../myproject-commit$i.tgz .; done
but it also archives all the files in the current directory which are not
git add
ed to the repo... How to avoid this problem?
git bundle
命令。它创建一个类似只读仓库的捆绑包。请参阅 https://www.git-scm.com/docs/git-bundle。 - ElpieKay.bundle
文件,但似乎无法在没有git
的情况下访问它,所以这并不是我正在寻找的东西。 - Basjmyproject-commit3-67d91ab.zip
已经足够明确了,但现在我已经编辑过以添加更多细节。 - Basj