How to download .zip from GitHub for a particular commit sha?


I want to download a .zip with the source of a library hosted on github, but I don’t want the master, because every time I download I could be downloading a different version.

This particular library does not have tags, so I can’t use that.

So how do I download the for a specific commit sha?


You can put the sha that you want in the download url:{username}/{projectname}/archive/{sha}.zip

As a general rule, if you have a url that works, you can replace “master” with the specific sha you want.

On unix:


Keep in mind that if this is a private repo then wget will not work unless you pass an OAuth token as well.

Here’s more info on that:

Having trouble downloading Git archive tarballs from Private Repo

Leave a Reply