git subtree
#git
サブツリーの追加
$ git remote add <repo_name> https://github.com/xxx/yyy.git
$ git subtree add --prefix=path/to/dir <repo_name> <branch_name>
例
git subtree add --prefix=path/to/dir origin gh-pages
サブツリーへのプッシュ
$ git subtree push --prefix=path/to/dir <repo_name> <branch_name>
gh_pages の例
git subtree push --prefix public/ origin gh-pages
cookbooks/build-essential を pull する例
参考: http://stackoverflow.com/questions/9777564/git-subtree-pull-complications
$ git remote add build-essential https://github.com/opscode-cookbooks/build-essential.git
$ git pull --squash -s subtree build-essential master
以下のやり方だとエラーになって失敗した
--squash 抜いてみたら conflict 発生してより面倒なことになった
$ git remote add build-essential https://github.com/opscode-cookbooks/build-essential.git
$ git subtree pull --prefix=cookbooks/build-essential build-essential master --squash
git subtree