# Basic git-archive --remote question

3 messages from 2013-06-24 to 2013-06-26. Participants: Greg Freemyer, Carlos Martín Nieto, Jeff King.
Thread: https://gitlist.dev/t/34270

## Greg Freemyer, 2013-06-24 19:53

Subject: Basic git-archive --remote question
Message-ID: <CAGpXXZJuC09t8-5d=p4KNs9rQ-S347eBNuKcKWFhXZTnkLW0sA@mail.gmail.com>
URL: https://gitlist.dev/e/CAGpXXZJuC09t8-5d%3Dp4KNs9rQ-S347eBNuKcKWFhXZTnkLW0sA%40mail.gmail.com
In-Reply-To: <CAGpXXZJifb1KmR8=VZVW+1MKjyo7HOq=OgU_rcHs-vc5ezfG6w@mail.gmail.com>

```
I'm trying to create a tarball from a git tag and I can't get the
syntax right.  The documentation is not very clear.

Can someone help me?

== details

git v1.8.1.4

The upstream git repo is at: https://github.com/dkovar/analyzeMFT

Here's a few attempts using git as the protocol:

> git archive --format=tar --remote=github.com:dkovar/analyzeMFT.git v2.0.4

Permission denied (publickey).
fatal: The remote end hung up unexpectedly

> git archive --format=tar --remote=git://github.com/dkovar/analyzeMFT v2.0.4

fatal: remote error
   Your Git client has made an invalid request:
   003agit-upload-archive /dkovar/analyzeMFT

> git archive --format=tar --remote=//github.com/dkovar/analyzeMFT v2.0.4

remote: fatal: '//github.com/dkovar/analyzeMFT.git' does not appear to
be a git repository
fatal: sent error to the client: git upload-archive: archiver died with error
remote: git upload-archive: archiver died with error

The github page also says I can use ssh with git as the user, but that
complains I don't have the private key (which I don't):

git archive --format=tar
--remote=ssh://git@github/com/dkovar/analyzeMFT.git v2.0.4


Thanks
Greg

```

## Carlos Martín Nieto, 2013-06-25 13:16

Subject: Re: Basic git-archive --remote question
Message-ID: <1372166198.20511.5.camel@flaca.cmartin.tk>
URL: https://gitlist.dev/e/1372166198.20511.5.camel%40flaca.cmartin.tk
In-Reply-To: <CAGpXXZJuC09t8-5d=p4KNs9rQ-S347eBNuKcKWFhXZTnkLW0sA@mail.gmail.com>

```
On Mon, 2013-06-24 at 15:53 -0400, Greg Freemyer wrote:
> I'm trying to create a tarball from a git tag and I can't get the
> syntax right.  The documentation is not very clear.
> 
> Can someone help me?
> 
> == details
> 
> git v1.8.1.4
> 
> The upstream git repo is at: https://github.com/dkovar/analyzeMFT
> 
> Here's a few attempts using git as the protocol:
> 
> > git archive --format=tar --remote=github.com:dkovar/analyzeMFT.git v2.0.4
> 
> Permission denied (publickey).
> fatal: The remote end hung up unexpectedly

Assuming you haven't set up any ssh rules for the github.com host,
you're trying to log in with ssh with your local username, which isn't
going to work.

> 
> > git archive --format=tar --remote=git://github.com/dkovar/analyzeMFT v2.0.4
> 
> fatal: remote error
>    Your Git client has made an invalid request:
>    003agit-upload-archive /dkovar/analyzeMFT
> 

This is the right format. GitHub doesn't allow remote archive requests,
which is why it's complaining.

If you want a tarball from GitHub, you need to download over HTTP from
the links they provide (which you can find e.g. through the web UI).

> 
> The github page also says I can use ssh with git as the user, but that
> complains I don't have the private key (which I don't):
> 
> git archive --format=tar
> --remote=ssh://git@github/com/dkovar/analyzeMFT.git v2.0.4

Using git as the ssh user is the right thing (if you want to talk git
over ssh) with GitHub and a few other sites/hosting programs, as your
public key is used to determine which user is trying to connect without
giving each user an account on the underlying OS.

   cmn

```

## Jeff King, 2013-06-26 07:01

Subject: Re: Basic git-archive --remote question
Message-ID: <20130626070105.GA5905@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20130626070105.GA5905%40sigill.intra.peff.net
In-Reply-To: <CAGpXXZJuC09t8-5d=p4KNs9rQ-S347eBNuKcKWFhXZTnkLW0sA@mail.gmail.com>

```
On Mon, Jun 24, 2013 at 03:53:56PM -0400, Greg Freemyer wrote:

> I'm trying to create a tarball from a git tag and I can't get the
> syntax right.  The documentation is not very clear.
> [...]
> > git archive --format=tar --remote=github.com:dkovar/analyzeMFT.git v2.0.4

Your remote should be git@github.com:dkovar/analyzeMFT.git.

But...

> > git archive --format=tar --remote=git://github.com/dkovar/analyzeMFT v2.0.4
> 
> fatal: remote error
>    Your Git client has made an invalid request:
>    003agit-upload-archive /dkovar/analyzeMFT

Your syntax is fine, but GitHub does not support remote git-archive
requests. Not over git://, and not over ssh. In both cases the error
messages are rather confusing and unhelpful, though.

> > git archive --format=tar --remote=//github.com/dkovar/analyzeMFT v2.0.4

This is wrong, as it is looking for //github.com... in the local
filesystem.

> The github page also says I can use ssh with git as the user, but that
> complains I don't have the private key (which I don't):
> 
> git archive --format=tar
> --remote=ssh://git@github/com/dkovar/analyzeMFT.git v2.0.4

If you have a GitHub account and register your public key, then you can
use ssh to fetch from the repository (using the git@github.com:user/repo
syntax). However, remote git-archive is not currently supported, so it
would not help you.

-Peff

```
