Skip to content

Bash - GitHub Downloader

Source: How to download a project subdirectory from GitHub (Example) (coderwall.com)

My customized script (requires snv to be installed):

#!/bin/bash

user=$1
repo=$2
path=$3
dest=$4

svn export "https://github.com/$user/$repo/trunk/$path" "$dest"

Invoke like so:

./github-downloader.sh "jimbrig" "dotfiles-wsl" "scripts/dev/scripts" "scripts" 

This will pull all the contents of the directory on GitHub at https://github.com/jimbrig/dotfiles-wsl/scripts/dev/scripts/ into a local directory named scripts.

Very useful!


Backlinks:

list from [[Bash - GitHub Downloader]] AND -"Changelog"