Skip to content

Instantly share code, notes, and snippets.

@cocoy
Created March 9, 2012 14:45
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 cocoy/2006803 to your computer and use it in GitHub Desktop.
Save cocoy/2006803 to your computer and use it in GitHub Desktop.
Using git subtree to checkout a subdirectory
cd /tmp
git clone https://github.com/riptano/chef.git chef
cd chef
git subtree split -P cookbooks/cassandra/ -b cassandra
cd /tmp
mkdir cassandra
git init
git fetch ../chef cassandra
git checkout -b master FETCH_HEAD
## create github repo for cassandra
git remote add origin git@github.com:cocoy/chef-cassandra.git
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment