git subtree split does just that. Given a folder through --prefix , it will generate a separate tree inside your repo, which you can click on to another repository and then use as you like.
The current version of git (1.8.1) does not include subtree documentation, but you can find it here: https://github.com/apenwarr/git-subtree/blob/master/git-subtree.txt
You can use the stream:
The last wil command re-partition the tree (using previously split commits to preserve the integrity of the C tree) and click on C/master .
If you want to delete history in content pressed in C , you can use the --squash option when git split -ing and git push -ing. You must be consistent and continue to use it in the future, because if you start mixing crushed and non-crushed subtree of content, you will not be able to correctly split and reuse previos distributions, and therefore, you will not be able to press it on C
Finally, once you have created the first sub split, it is not necessary that you delete it, and reimport as a new subtree. If you save it, git subtree will simply regenerate / reuse previously created commits from other sections. If you delete the folder and then add sub from the generated commits, it should still work, and if you use --squash , it will match what you want if C has no history, but keeping A history).
source share