# export one commit id from a repository

3 messages from 2010-05-22 to 2010-05-23. Participants: Gelonida, Abhijit Menon-Sen.
Thread: https://gitlist.dev/t/23877

## Gelonida, 2010-05-22 13:41

Subject: export one commit id from a repository
Message-ID: <ht8mu6$hjo$1@dough.gmane.org>
URL: https://gitlist.dev/e/ht8mu6%24hjo%241%40dough.gmane.org

```
Hi,

I'm having a bare git repository on a server.

I'd like to be able to concurrently (multiuser) create tar files from
certain commmit ids.

How can I do this most efficiently.


How I do this today:
- ssh to the server.
- clone the bare repository to a temp directory.
- checkout a certain version.
- remove the .git directory
- tar it up
- scp it to my local host
- remove the temp directory and the tar file

svn had the command 'export'


Thanks a lot for help or pointing me to existing scripts / tools.

```

## Abhijit Menon-Sen, 2010-05-22 13:50

Subject: Re: export one commit id from a repository
Message-ID: <20100522135047.GA10999@toroid.org>
URL: https://gitlist.dev/e/20100522135047.GA10999%40toroid.org
In-Reply-To: <ht8mu6$hjo$1@dough.gmane.org>

```
At 2010-05-22 15:41:26 +0200, gelonida@gmail.com wrote:
>
> I'd like to be able to concurrently (multiuser) create tar files from
> certain commmit ids.

git archive --prefix=foo/ $sha1 | gzip > foo.tar.gz

See git-archive(1).

-- ams

```

## Gelonida, 2010-05-23 10:08

Subject: Re: export one commit id from a repository
Message-ID: <htauri$17m$1@dough.gmane.org>
URL: https://gitlist.dev/e/htauri%2417m%241%40dough.gmane.org
In-Reply-To: <20100522135047.GA10999@toroid.org>

```
Thanks a lot for your answer.

That's what I was looking for :-)

Abhijit Menon-Sen wrote:
> At 2010-05-22 15:41:26 +0200, gelonida@gmail.com wrote:
>> I'd like to be able to concurrently (multiuser) create tar files from
>> certain commmit ids.
> 
> git archive --prefix=foo/ $sha1 | gzip > foo.tar.gz
> 
> See git-archive(1).
> 
> -- ams

```
