I have a Git Repository. I want to export all files and folders from my repository history, based on the different commits, into a folder. But I want to export all commits and branches separately. A sort of backup/archive for my git repository.
For example if I have a repository history of:
-v2.0 My Latest commit -v1.0 My Initial commit
I want to export all files and folders of these different commits into separate folders. I want the files as normal complete files not as a difference patch.
For example the folders "/MyGitBackup/Master/v1.0" and "/MyGitBackup/Master/v2.0" which should include the files of the according commits.
How can I achieve this? Is a GUI tool capable of this or something similar? I use a Windows machine.
解决方案
You can use git worktree that enables to checkout different commits to different directories.
So, execute the following commands in your working directory:
git worktree add /MyGitBackup/Master/v1.0
git worktree add /MyGitBackup/Master/v2.0