Hacker News new | ask | show | jobs
by apatap 3616 days ago
Wouldn't git subtrees be a better option than git submodules?

(see: http://blogs.atlassian.com/2013/05/alternatives-to-git-submo... and https://codingkilledthecat.wordpress.com/2012/04/28/why-your... )

3 comments

These are little pleasures and forgive the tiny vanity moment: I wrote the first article you linked. I also wrote more recently a follow up on just subtree: https://developer.atlassian.com/blog/2015/05/the-power-of-gi...
I remember reading that article a year ago. Thank you for it, it's served as a reference for me since :)
git subtree have one bis disadvantage, git log will look like a hell, because all subtrees' commits also will be shown.
Unless you use --squash, but you have to remember to pass it.
I found that this makes rebasing a feature branch really difficult. The alternative is not much better.
I'm using subtrees to vendor C dependencies and it works well. Submodules are problematic as they may disappear or the git repo might be down. If your dependency is read only, subtree is a better option IMO.