すべてがエクスポートしたい一つのディレクトリ下にあり、あなたが本当に他のすべてを省略したい、あなたはgitのフィルタ分岐でダウン枝をフィルタリングして、レポB.
に出ちょうどその結果枝をプッシュする可能性がある場合興味のある枝の先端から
、あなただけの「公共」ディレクトリに変更し、下記維持したいと仮定すると:そして、あなたが分岐nameOfPublicBranch上のいずれかにコミットをダウンスカッシュしたい場合は
git checkout -b nameOfPublicBranch
// Create a new branch where you want to start to filter
git filter-branch -f --subdirectory-filter public
// This filters your branch down to commits that modified public (and below)
git push repoB nameOfPublicBranch
// now export to repoB just this stuff that you wanted on your branch nameOfPublicBranch
git checkout <yourOldBranchName>
// get back to your old branch
をくださいあなたがそれを押す前にそれにrebaseのスカッシュ。
これには他にも多くの方法があります.1つはサブモジュールの使用であり、このアプローチ(履歴の書き換え)には意図しない問題がある可能性があります。
[関連する回答](http://stackoverflow.com/a/38099643/4233593)をご覧ください。 –