threads / discuss / 31364

exporting a .git file ?

Subject: exporting a .git file ?

## tl;dr

8 messages between Aug 27, 2012 and Aug 27, 2012.

replies: 7people: 6as markdown or json

Aaron Gray· Aug 27, 2012, 14:39 UTC · re: Mihamina Rakotomandimby · lore

Re: exporting a .git file ?

On 27 August 2012 15:35, Mihamina Rakotomandimby <mihamina@rktmb.org> wrote:
Show 7 quoted lines
> On 08/27/2012 05:32 PM, Aaron Gray wrote:
>>
>> Is there anyway to get my git repository as a single file ?
>
>
> What is the purpose?
> ".git/" is a folder...

I realize that but I wanted to distribute it as a downloadable file without having to use a server.

Aaron
Andreas Schwab· Aug 27, 2012, 15:09 UTC · re: Aaron Gray · lore

Re: exporting a .git file ?

Aaron Gray <aaronngray.lists@gmail.com> writes:
> I realize that but I wanted to distribute it as a downloadable file
> without having to use a server.
git bundle can create a single file from the object database.
Andreas.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Dan Johnson· Aug 27, 2012, 14:45 UTC · re: Aaron Gray · lore

Re: exporting a .git file ?

On Mon, Aug 27, 2012 at 10:32 AM, Aaron Gray <aaronngray.lists@gmail.com> wrote:
> Hi,
>
> Is there anyway to get my git repository as a single file ?

You're probably looking for the git bundle command (see git bundle --help), but it's possible you might just want to use tar.

Hope that helps,
-- 
-Dan
Aaron Gray· Aug 27, 2012, 14:48 UTC · re: Dan Johnson · lore

Re: exporting a .git file ?

On 27 August 2012 15:45, Dan Johnson <computerdruid@gmail.com> wrote:
Show 9 quoted lines
> On Mon, Aug 27, 2012 at 10:32 AM, Aaron Gray <aaronngray.lists@gmail.com> wrote:
>> Hi,
>>
>> Is there anyway to get my git repository as a single file ?
>
> You're probably looking for the git bundle command (see git bundle
> --help), but it's possible you might just want to use tar.
>
> Hope that helps,
Great thanks Dan, comes in under 2 megs, thats great.
Aaron
Michael Haggerty· Aug 27, 2012, 15:40 UTC · re: Dan Johnson · lore

Re: exporting a .git file ?

On 08/27/2012 04:45 PM, Dan Johnson wrote:
Show 7 quoted lines
> On Mon, Aug 27, 2012 at 10:32 AM, Aaron Gray <aaronngray.lists@gmail.com> wrote:
>> Hi,
>>
>> Is there anyway to get my git repository as a single file ?
> 
> You're probably looking for the git bundle command (see git bundle
> --help), but it's possible you might just want to use tar.

Please note that a "git bundle" will contain the contents of the repository (commits, log messages, etc) but not the local configuration like .git/config, .git/info/*, nor some other information like the reflogs (history of old values of references). This is probably what you want.

A "tar" of the .git directory, by contrast, would include this local information unless you exclude it explicitly.

Michael
-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Konstantin Khomoutov· Aug 27, 2012, 14:53 UTC · re: Aaron Gray · lore

Re: exporting a .git file ?

On Mon, 27 Aug 2012 15:32:40 +0100 Aaron Gray <aaronngray.lists@gmail.com> wrote:

> Is there anyway to get my git repository as a single file ?
Depends on what you really need.

If you need to export the repository *history* of one or more references (branches or tags), use `git bundle` to create a specially-formatted file which can be imported using Git on another machine.

If you need to just export the snapshot of the files maintained in the repository at the specified commit, use `git export`.

← back to recent threads