Download a specific branch of a github project

Ali Shakiba picture Ali Shakiba · Sep 1, 2015 · Viewed 59.6k times · Source

To cut the story short, to run a convolutional neural network model, I need an special version of nolearn, which has a url of the form https://github.com/dnouri/nolearn/tree/1659e4811e498dc1f442d8e6486d0831f85255b4/nolearn . However, there are no Download as Zip buttons at the page, nor I can download it with

git clone https://github.com/dnouri/nolearn -branch 1659e4811e498dc1f442d8e6486d0831f85255b4/nolearn

Simply,

git clone https://github.com/dnouri/nolearn/tree/1659e4811e498dc1f442d8e6486d0831f85255b4/nolearn

does not work, too.

Even, I have no idea what should I search for in Google!

Note: This is the last version which provided support for the class Objective, i.e. the command from lasagne.objectives import Objective is no more supported!

Answer

mayo picture mayo · Sep 1, 2015

This can help you:

How to clone a single branch in git?

Where specifies:

git clone <url> --branch <branch> --single-branch [<folder>]

Docu :

Git Clone

--[no-]single-branch

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. When creating a shallow clone with the --depth option, this is the default, unless --no-single-branch is given to fetch the histories near the tips of all branches. 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.