Is there a link to GitHub for downloading a file in the latest release of a repository?

Using GitHub’s Release feature, it is possible to provide a link to download a specific version of the published software. However, every time a release is made, the gh-page also needs to be updated.

Is there a way to get a link to a specific file of whatever the latest version of a software is?

e.g., this would be a static link:

What I’d like is something like:

NOTE: The difference between this question and
GitHub latest release is
that this question specifically asks for getting access to the file,
not the GitHub latest release page

  • github releases in relation to branching, as used by jitpack
  • Maven release with jenkins slave and Credentials : how to pass SCM credentials to maven?
  • maven release -> peer not authenticated
  • Centralized GIT workflow/deployment - Release Branch
  • Gradle bitbucket/git release plugin
  • Maven doesn't copy untracked resources while releasing
  • Fixing bugs in old releases in workflow as described by Adam Dymitruk (“branch per feature”)
  • Git Release Branch with Squashed Commits
  • 11 Solutions collect form web for “Is there a link to GitHub for downloading a file in the latest release of a repository?”

    You can do ajax request to get latest release download URL using GitHub Releases API like this:

    <script type="text/javascript">
        $(document).ready(function () {
        function GetLatestReleaseInfo() {
            $.getJSON("").done(function (release) {
                var asset = release.assets[0];
                var downloadCount = 0;
                for (var i = 0; i < release.assets.length; i++) {
                    downloadCount += release.assets[i].download_count;
                var oneHour = 60 * 60 * 1000;
                var oneDay = 24 * oneHour;
                var dateDiff = new Date() - new Date(asset.updated_at);
                var timeAgo;
                if (dateDiff < oneDay)
                    timeAgo = (dateDiff / oneHour).toFixed(1) + " hours ago";
                    timeAgo = (dateDiff / oneDay).toFixed(1) + " days ago";
                var releaseInfo = + " was updated " + timeAgo + " and downloaded " + downloadCount.toLocaleString() + " times.";
                $(".sharex-download").attr("href", asset.browser_download_url);

    It also shows when it was released and what the download count is:

    enter image description here

    jQuery needed for this to work.

    Also it is important for you to set latest release URL to download button like this:

    So if browser does not support ajax (or javascript) or is too slow to get the URL, the download button will still work.

    When Ajax request complete then URL of this button will change automatically to direct download URL.


    I also made downloads page that shows multiple releases which you can find here:

    You can do View page source to check how it works. But also you can see it from here:

    Linux solution to get latest release asset download link (works only if release has one asset only)

    curl -s | grep browser_download_url | cut -d '"' -f 4

    From the command line using curl and jq, retrieves the first file of the latest release:

    curl -s | \
      jq --raw-output '.assets[0] | .browser_download_url'

    Another Linux solution using curl and wget to download a single binary file from the latest release page

    curl -s -L | egrep -o '/bosun-monitor/bosun/releases/download/[0-9]*/scollector-linux-armv6' | wget --base= -i - -O scollector


    curl -s -L is to silently download the latest release HTML (after following redirect)

    egrep -o '...' uses regex to find the file you want

    wget --base= -i - converts the relative path from the pipeline to absolute URL

    and -O scollector sets the desired file name.

    may be able to add -N to only download if the file is newer but S3 was giving a 403 Forbidden error.

    Just use one of the urls below to download the latest release:
    (took urls from boxbilling project for example):

    Download the latest release as zip:

    Download the latest release as tarball:

    Click on one of the urls to download the latest release instantly. As i wrote this lines it’s currently: boxbilling-boxbilling-4.20-30-g452ad1c[.zip/.tar.gz]

    UPDATE: Found an other url in my logfiles (ref. to example above)

    As noted previously, jq is useful for this and other REST APIs.

    tl;dr – more details below

    Assuming you want the macOS release:

    URL=$( curl -s "" \
       | jq -r '.assets[] | select(.name=="") | .browser_download_url' )
    curl -LO "$URL"

    Solution for atom releases

    Note each repo can have different ways of providing the desired artifact, so I will demonstrate for a well-behaved one like atom.

    Get the names of the assets published

    curl -s "" \
        | jq -r '.assets[] | .name'

    Get the download URL for the desired asset

    Below atom-mac is my desired asset via jq’s select(.name=="")

    curl -s "" \
        | jq -r '.assets[] | select(.name=="") | .browser_download_url'

    Download the artifact

    curl -LO ""

    jq Playground

    jq syntax can be difficult. Here’s a playground for experimenting with the jq above:


    You should take measures to ensure the validity of the downloaded artifact via sha256sum and gpg, if at all possible.

    The Linking to releases help page does mention a “Latest Release” button, but that doesn’t get you a download link.

    For that, you need to get the latest tag first (as mentioned in “GitHub URL for latest release of the download file?”):

    latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
    curl -L$latestTag/ReactiveUI-$

    in PHP – redirect to the latest release download. Simply put on your webspace

     * Download latest release from github release articats
     * License: Public Domain
    define('REPO', 'imi-digital/iRobo');
    $opts = [
        'http' => [
            'method' => 'GET',
            'header' => [
                'User-Agent: PHP'
    $context = stream_context_create($opts);
    $releases = file_get_contents('' . REPO . '/releases', false, $context);
    $releases = json_decode($releases);
    $url = $releases[0]->assets[0]->browser_download_url;
    header('Location: ' . $url);

    I want to download the releases from the file in the repository description. There, I cannot execute JavaScript.

    I can add links like these to the README file or github pages for all of my repositories:

    This works because the JavaScript referrer is set and the repository to download is determined through document.referrer. Thus, teh link will also work for forks.

    You can find the source code here, fork or just use my repo.

    A solution using (an inner) wget to get the HTML content, filter it for the zip file (with egrep) and then download the zip file (with the outer wget).

    wget$(wget<USER>/<PROJECT>/releases/latest -O - | egrep '/.*/.*/.*zip' -o)

    In case that the repo is using just tags instead of release — cf. jQuery — the solutions which based on one URL does not work.

    Instead, you have to query all tags, sort them and construct the download URL. I implemented such a solution for the language Go and the jQuery repo: Link to Github.

    Perhaps, this helps someone.

    Git Baby is a git and github fan, let's start git clone.