github — how to clone specific directory (not just release)?

Newbie at git, but I’ve been trying to figure this out for an hour. How do I clone a specific release from github?

I want these files:
but that URL does not work with clone, so I can’t figure out how to get them.

I can clone this parent URL:
but that does not seem to have the files I want.

So how can I get that specific 3.1.1 release?

UPDATE: Issue solved. My question assumed that git allows you to clone a specific directory in the repo (and not have to also clone all the other directories you don’t care about). I now realize git just doesn’t support that; you apparently have to clone the entire repo and then just cd into the directory you want.

  • git - can't push to remote, error 'fatal: Not a git repository'
  • How to remove a commit that has been pushed to the remote repository using Git
  • A few questions about adding gitignore after multiple commits
  • Contributing to a core grunt task on github
  • SSH Agent Forwarding not working
  • Adding custom fonts to GitHub pages
  • Git merge one branch into two other branches
  • web2py git integration - localhost & pythonanywhere
  • 2 Solutions collect form web for “github — how to clone specific directory (not just release)?”

    Release v3.1.1 is essentially a tag.
    You can clone using that tag:

    git clone --branch v3.1.1


    git clone --branch v3.0.5

    To clone “Release 3.0.5”

    See How to git clone a specific tag

    You can clone anything you want with GIT.
    Branches tags, commit and so on.

    You simply have to pass the right parameter to the clone command.

    Gow to clone specific branch? (-b flag)

    # use the -b flag to clone a specifc branch 
    git clone -b <branch> <remote_repo>

    --single-branch flag


    Clone only the history leading to the tip of a single branch, either specified by the --branch option or the primary branch remote’s HEAD points at.

    Further fetches into the resulting repository will only update the remote-tracking branch for the branch this option was used for the initial cloning.

    If the HEAD at the remote did not point at any branch when --single-branch clone was made, no remote-tracking branch is created.

    git checkout tags/<tag name>

    Clone the repo and then checkout the desired tag:

    # Checkout specific tag and create branch with the desired name
    git checkout tags/<tag_name> -b <tag_name>
    Git Baby is a git and github fan, let's start git clone.