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?

DD.
  • 3,114
  • 11
  • 35
  • 50

3 Answers3

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
Sirch
  • 5,785
  • 4
  • 20
  • 36
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

kenorb
  • 6,499
  • 2
  • 46
  • 54
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
Bart De Vos
  • 17,911
  • 6
  • 63
  • 82