Reputation: 126075
I'm often building servers where the goal is to install some software that is stored in Github. The process goes:
Steps 1 and 2 can be pretty slow (a few minutes). Are there any tools that would allow me to cut to the chase, step 3? I'm thinking something like:
Upvotes: 2
Views: 3945
Reputation: 124648
You could get a tarball using the GitHub API, and then you could get a branch and extract it in one go:
curl -u USER:TOKEN https://api.github.com/repos/USER/REPO/tarball/BRANCH -L | tar zt
You can create your token following the steps on this page. It's easy enough to do.
Or you could get a sub-directory using svn
:
svn checkout https://github.com/USER/REPO/branches/BRANCH/subdir/you/want
The good thing about both solutions is that they don't download the full history, only the snapshot of the latest state.
Upvotes: 1
Reputation: 2062
curl or wget:
curl -o foo.zip https://github.com/<user>/<project>/archive/<branch>.zip
wget https://github.com/<user>/<project>/archive/<branch>.zip
that said, in my experience, installing git only takes a few seconds
Upvotes: 1
Reputation: 9197
If you want to use git and if your git is new enough to have --single-branch
:
git clone --single-branch --branch=<branch> --depth=1
Otherwise, you can download the source in a zip:
wget https://github.com/<user>/<project>/archive/<branch>.zip
Upvotes: 4