Re: [git-users] Re: git subtree workflow
Hmm, I just assumed I should use subtree because pretty much every single thing I've ever read that references them says that subtree is preferable to submodules in nearly every way. Are submodules better in this case for some reason? On Wed, Feb 27, 2013 at 2:29 PM, Gergely Polonkai gerg...@polonkai.euwrote: If you are familiar with symlinks under Linux, you can think of submodules as such. You add a reference to another git repository, check it out to a subdirectory, and you are done. The Git book has a chapter on it: http://git-scm.com/book/en/Git-Tools-Submodules On 27 February 2013 23:21, Ben McCann benjamin.j.mcc...@gmail.com wrote: Anyone have any experience using subtree? Thanks! -Ben On Monday, February 25, 2013 8:21:50 PM UTC-8, Ben McCann wrote: I'm fairly new to git and am trying to determine if git subtree would be helpful for managing our company's codebase, which has several repos some of which depend on each other. All the examples I've seen make sense to me as a one-time operation to merge separate repos into one monolithic one or to split one monolithic repo into separate repos. I'm having a harder time understanding how this fits into a larger picture and what the workflow for working with subtree would be. If I have a bunch of repos on GitHub and some depend on each other, how would I set them up to work with subtree? Would GitHub continue to host them as is, host a merged monolithic repo, or host both a monolithic repo and the splitted out repo? The exact answer probably varies, but I imagine there's basic workflow that would satisfy 80% of users. If I have GitHub host both monolithic and splitted out repos, it seems unclear as to how I keep those repos in sync and make sure all the developers in our company push their changes to both repos. Thanks, Ben -- 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. -- You received this message because you are subscribed to a topic in the Google Groups Git for human beings group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/git-users/GnE7-hfT6z4/unsubscribe?hl=en-US . To unsubscribe from this group and all its topics, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- about.me/benmccann -- 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.
Re: [git-users] Re: git subtree workflow
Hmm, that's interesting to hear. I'd read a couple articles that led me to believe I shouldn't consider submodules at all (e.g. these two on HN: Git Subtree merged into mainline githttp://news.ycombinator.com/item?id=3926683 , Why your company shouldn't use Git submoduleshttp://news.ycombinator.com/item?id=3904932), but they do seem easier to setup and maintain in this case as far as I can tell as a complete beginner, so I guess I'll have to look into them. Thanks for the help! -Ben On Wed, Feb 27, 2013 at 2:53 PM, Gergely Polonkai gerg...@polonkai.euwrote: Sorry, I wasn't totally clear. Forgive me as I'm in the middle of a bad flu :) As Ryan says, hosting both the monolithic stuff AND the modules can be dangerous, unless the modules are actually independent. The Symfony project, for example, hosts the whole framework in a large github repo, and maintains a read only version of most of its modules in separate repos. This seems to be a good use-case for subtree. For your scenario, I would suggest submodules. On 27 February 2013 23:41, Ryan Hodson hodson.r...@gmail.com wrote: Hi Ben, To expand on Gergely's reply a bit, it sounds like what you're looking for is `git submodule`, not `git subtree`. Submodules were designed to solve exactly the problem you're facing. Each submodule is essentially its own independent Git repository. If you have RepoA that relies on RepoB, you would add RepoB as a submodule to RepoA. Then you can pull in upstream commits from RepoB as you would with a normal Git workflow and access them from RepoA. There are a few extra `git submodule` commands you would need to learn to keep things in sync. If I have GitHub host both monolithic and splitted out repos, it seems unclear as to how I keep those repos in sync and make sure all the developers in our company push their changes to both repos. This sounds like a dangerous idea. I would use submodules instead. Ryan -- 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. -- You received this message because you are subscribed to a topic in the Google Groups Git for human beings group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/git-users/GnE7-hfT6z4/unsubscribe?hl=en-US . To unsubscribe from this group and all its topics, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- about.me/benmccann -- 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.
[git-users] git subtree workflow
I'm fairly new to git and am trying to determine if git subtree would be helpful for managing our company's codebase, which has several repos some of which depend on each other. All the examples I've seen make sense to me as a one-time operation to merge separate repos into one monolithic one or to split one monolithic repo into separate repos. I'm having a harder time understanding how this fits into a larger picture and what the workflow for working with subtree would be. If I have a bunch of repos on GitHub and some depend on each other, how would I set them up to work with subtree? Would GitHub continue to host them as is, host a merged monolithic repo, or host both a monolithic repo and the splitted out repo? The exact answer probably varies, but I imagine there's basic workflow that would satisfy 80% of users. If I have GitHub host both monolithic and splitted out repos, it seems unclear as to how I keep those repos in sync and make sure all the developers in our company push their changes to both repos. Thanks, Ben -- 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.