Last active
August 29, 2015 14:06
-
-
Save phatblat/a5caa3bb3a3784f03000 to your computer and use it in GitHub Desktop.
Git sparse checkout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tmpdir=/tmp/phatblat-images | |
subdir=images/ | |
remote_git=git://github.com/phatblat/phatblat.github.io.git | |
remote_https=https://github.com/phatblat/phatblat.github.io.git | |
mkdir $tmpdir | |
cd $tmpdir | |
git init | |
git remote add -f origin $remote_git || \ | |
git remote set-url origin $remote_https && \ | |
git fetch origin | |
git config core.sparseCheckout true | |
echo "$subdir" > .git/info/sparse-checkout | |
git checkout master | |
open $subdir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment