Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git subtree or Git Sub module for large resources?

Here is the problem: I have a lot of code, including artwork for the GUI I need to version in order to faithfully recreate a software product. I am also working on both Windows and Mac. The actual code I'm working on that will change on a daily basis is really small. However, all the related resources total to about a few GB before its built.

From my research online, it seems like either git-subtree or git-submodule is what I would need to use to keep my git repository fast.

I'm sure a lot of you git users out there faced a similar problem and have been confronted with the same decision.

Which approach have you used and what problems have you faced down the line?

like image 616
Carl Avatar asked Aug 09 '11 22:08

Carl


People also ask

Should I use git subtree?

If you own an external repository to which you will likely push code, use Git submodule because it is easier to push. Use Git subtree if there is a third-party code that you are doubtful to push to because it is easier to pull.

Is git submodule a good idea?

Git submodules may look powerful or cool upfront, but for all the reasons above it is a bad idea to share code using submodules, especially when the code changes frequently. It will be much worse when you have more and more developers working on the same repos.

Why do we need git submodule?

Git submodules allow you to keep a git repository as a subdirectory of another git repository. Git submodules are simply a reference to another repository at a particular snapshot in time. Git submodules enable a Git repository to incorporate and track version history of external code.

Which term defines git repositories that are included as subdirectories in another repository?

Submodules allow you to keep a Git repository as a subdirectory of another Git repository. This lets you clone another repository into your project but still keep your commits to that project separate.


1 Answers

A single monolithic git repository will work just fine. Large resources that don't change will only be copied once when you clone.

If you happen to have any large resources that change over time, you might find git-media useful.

like image 114
Marcelo Cantos Avatar answered Nov 24 '22 02:11

Marcelo Cantos