Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git - export archive with commit history

Tags:

git

github

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?

like image 301
endline Avatar asked Aug 01 '14 09:08

endline


People also ask

Does git archive include history?

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.

How do I watch commit history?

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.

Does git clone copy commit history?

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.


1 Answers

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

like image 170
1615903 Avatar answered Sep 20 '22 01:09

1615903