3

I'm trying to download a zipball of a git repo:

e.g.

wget https://github.com/zeromq/jzmq/zipball/master

This works fine in a web browser but on unix the file gets a weird name...how do I do this?

3 Answers 3

0

When you say weird name, what do you mean?

This should however just be a ZIP-file. It just doesn't have the extension.

You can check this with the following command:

file master

You can unzip it with this command:

unzip master
2
  • master isnt the name of the final zipfile, its a redirect.
    – Sirch
    May 16, 2012 at 10:54
  • I know, but I don't know what it's going to be, so I use master here. Nonetheless, it'll be a ZIP-file. May 16, 2012 at 11:02
1

You also get a 'weird name' in your web browser, the server is redirecting you from

https://github.com/zeromq/jzmq/zipball/master

to somewhere on nodeload.github.com, are you saying that wget isnt following these redirects? Can you paste the output, and show the results of wget, with an ls -l.

If you want to make sure that the downloaded file has another name, use the -O option.

wget -O myzip.zip https://github.com/zeromq/jzmq/zipball/master
1

Try the following command:

git archive --remote=git://git.foo.com/project.git HEAD:path/to/directory filename

Source:

https://stackoverflow.com/questions/1125476/git-retrieve-a-single-file-from-a-repository

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .