How do I archive export a git repository at a specified commit with commit history?
Using git archive --output=test.zip 898a4ca
exports the files but there is no .git, and hence no commit history or branches.
Basically I want to be able to export a git repo at a certain point in time - including the commit history and branches to that point.
This is useful for giving clients a copy of the repo up until the milestones they have paid for.
Is this possible?
Use Git Archive for Files The available list of formats can be retrieved with the git archive --list command. But the Git archive command includes only the files, not the history of those files.
On GitHub.com, you can access your project history by selecting the commit button from the code tab on your project. Locally, you can use git log . The git log command enables you to display a list of all of the commits on your current branch. By default, the git log command presents a lot of information all at once.
Each clone usually includes everything in a repository. That means when you clone, you get not only the files, but every revision of every file ever committed, plus the history of each commit.
You can use git bundle
to do that:
git bundle create <filename> <commit you want>
See the documentation for more details: http://www.git-scm.com/docs/git-bundle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With