Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dump git history as a single file?

Tags:

git

I'd like to share repository as single file.

How can I export history into single file and import it on other side?

Is it possible to limit history with usual git syntax, like v1..v2?

like image 796
gavenkoa Avatar asked Feb 04 '26 17:02

gavenkoa


1 Answers

You probably want to create a git bundle. This will create a package that can be cloned later.

You can do this with the git bundle command.

Example (taken from Pro Git):

$ git bundle create repo.bundle HEAD master
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (6/6), 441 bytes, done.
Total 6 (delta 0), reused 0 (delta 0)


$ git clone repo.bundle repo
Cloning into 'repo'...
...
$ cd repo
$ git log --oneline
9a466c5 second commit
b1ec324 first commit
like image 113
Hasturkun Avatar answered Feb 06 '26 08:02

Hasturkun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!