Skip to content

Instantly share code, notes, and snippets.

@chucktrukk
Created January 24, 2010 12:09
Show Gist options
  • Save chucktrukk/285175 to your computer and use it in GitHub Desktop.
Save chucktrukk/285175 to your computer and use it in GitHub Desktop.
==Steps
1. Add remote
2. Fetch remote
2. checkout new branch at new remote
3. switch to master
4. read tree into new folder
==Example
git remote add REPO_remote [email protected]:schacon/rack.git
git fetch REPO_remote
git co -b BRANCH REPO_remote/master
git co master
git read-tree --prefix=DIRECTORY/ -u BRANCH
git ci -m 'import BRANCH subtree'
Example from 'Pro Git professional version control' by Scott Chacon and published by Apress
at http://progit.org/book/ch6-7.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment