• Repo API response for the REST API, including URLs and in some cases how to filter them using shell commands.

Clone

$ git clone CLONE_URL

Clone HTTPS

https://github.com/MichaelCurrin/cheatsheets.git

Clone SSH

git@github.com:MichaelCurrin/cheatsheets.git

Download URLs

Source code

e.g.

$ curl -O DOWNLOAD_URL

master

$ curl -O https://github.com/MichaelCurrin/cheatsheets/archive/master.zip

Then you have a file master.zip.

Feature branch

Note this link will not work in this case as this is not an existing branch.

Specific tag

Usage - note, you do need -L to follow a redirect.

$ curl -L -O https://github.com/MichaelCurrin/cheatsheets/archive/v1.0.0.zip

Assets

Latest release

Based on GH docs - Linking to a Release.

Download the latest release’s assets:

/owner/name/releases/latest/download/asset-name.zip

But, I find that doesn’t work for me.

e.g. this is invalid:

But this works:

Also the other assets on there have the tag name in actual filename, so you can’t just do a generic way.

See assets here:

GitHub UI URLs

The examples here are using Go Project Template repo.

This has releases which contain both

  • source code of the repo at that tag point, as an archive (.zip and .tar.gz).
  • assets generated by CI or attached manually. (.tar.gz containing binary executables)

All releases

Target release

Download binary:

Download tarball:

Latest release

Point to the latest release without having to specify an exact tag number.

Note this only works if your have a release not a pre-release, and you need to make the release and not just use a tag.

e.g.

That redirects you to the actual latest release page like:

Or it falls back to a page of all releases.