Best way to export a git repo and include reflog

238 views Asked by At

I want to save and share a git repo with everything in it, including the current reflog state. Is the best way to do this just to zip up the .git directory? Or could there be a better way?

1

There are 1 answers

0
CodeWizard On BEST ANSWER

You can always use git bundle for this purpose.

How to create git bundle?

git bundle create mybundle --all

Or choose other flags as well instead of the --all

--branches[=<pattern>]

Pretend as if all the refs in refs/heads are listed on the command line as <commit>.
If <pattern> is given, limit branches to ones matching given shell glob.
If pattern lacks ?, , or [, / at the end is implied.

--tags[=<pattern>]

Pretend as if all the refs in refs/tags are listed on the command line as <commit>.
If <pattern> is given, limit tags to ones matching given shell glob.
If pattern lacks ?, , or [, / at the end is implied.