Skip to content

Instantly share code, notes, and snippets.

@micahbrich
Created August 6, 2015 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micahbrich/73197e9b51bf3761b1d6 to your computer and use it in GitHub Desktop.
Save micahbrich/73197e9b51bf3761b1d6 to your computer and use it in GitHub Desktop.
git-grab – snagging a specific piece of a git repo using SVN, of all things
#!/bin/bash
#######################################
# List the contents, or download a
# folder from a GitHub repo.
# Argument:
# HTTPS URI to folder
#######################################
echo ${1} | sed 's/tree\/master/trunk/g' | { read uri; (svn export $uri); }
@micahbrich
Copy link
Author

Throw this in a file in /usr/local/bin, name it git-grab, and chmod +x /usr/local/bin/git-grab. Run it the first time to set up your SVN credentials, but then by passing it a URL, you can download just a singular folder from a git repo. Credit to @h4w5 for figuring that shnaz out.

Usage: git grab https://github.com/generalassembly/wdi/tree/master/curriculum/baseline/11-deployment/heroku/deploying-a-node-application-lesson/starter-code/app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment