On Thursday, February 27, 2014 8:12:26 AM UTC+1, HWSWMAN wrote: > > I have a directory ./MAIN/ with /A/ and /B/ under MAIN > > ./MAIN/ > ./MAIN/A/ > ./MAIN/B/ > > A and B have their own repos ... i want to combine them so i have a repo > under MAIN, while keeping the history of A and B ... how can i do this? i > use sourcetree if any specific help using sourcetree is possible .. > otherwise i am somewhat comfortable using command line git then opening > that in sourcetree later .. > > any help is appreciated >
This sounds like a job for git subtree. Here's an extended article on it: http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/ So, first you want to move A and B out of the way: cd MAIN mv A .. mv B .. Now initialize MAIN into being a git repository: git init Now, add A and B as subtrees: git subtree add --prefix A ../A master git subtree add --prefix B ../B master Job done! Note that if you don't have the git subtree command in your Git installation, see the above mentioned blogpost for instructions on how to get it working. -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.