Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers 3

up vote 0 down vote accepted

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
share|improve this answer
    
master isnt the name of the final zipfile, its a redirect. –  Sirch May 16 '12 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. –  Bart De Vos May 16 '12 at 11:02
add comment

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
share|improve this answer
add comment

Try the following command:

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

Source:

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.