Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git single or separate for different project?

I would like to know which is a better choice of GIT management for my project?

I have a main project that requires development on Software, Firmware, and Mobile application, the project structure is shown below:

+ MainApplication
     + Software (Visual Studio project)
     + Mobile (Android project)
     + Firmware (ARM project)
     + Document

So, do I seperate each project (software, mobile, firmware) into a single GIT repo? or I just include all projects into a single big GIT?

I have the pros and cons listed below:

  • Single GIT

    • GOOD: I can track all the projects at once, and it is not fragmented and easier for me to manage
    • GOOD: it would be easier for people at start using this GIT, because everything is shown in a single GIT
    • GOOD: I can place the document into this main GIT
    • BAD: i cant tag or release each project, unless i prefix them and also it is difficult to track the commit for such a big projects
  • Multiple GIT

    • BAD: too many GIT repo, too fragmented, you need to provide 3 git link for each project instead of one, troublesome
    • BAD: i want to track my document folder too, it will be "funny" to create a single GIT jsut for this document folder
    • GOOD: can easily track each project problems and commits

UPDATE 1

There are really a lot of good feedback below, and I love some of the approach mention,

  • seperate GIT and group them together

    1. GOOD: i like this idea, because i could independently track each of them as mention above
    2. GOOD: and i could group all of the git, and i could browse them easily, rather than a huge git repo that you need to browse through
    3. BAD: sounds strange, you probably needs to create another git just to track the document folder
    4. SOLUTION:
      • In Github, you could use organization (sort of a hack to group all the gits, because now that git no longer belongs to your personal gits
      • In GitLab, you could use label, to group them, so you can easily sort them in the future
  • using Git submodule

    1. BAD: hard to use
    2. GOOD: ?
like image 539
Tim Avatar asked Oct 19 '25 04:10

Tim


2 Answers

The pro argument about "fragmented" repositories (and it's con counterpart) doesn't hold it's ground.

I can track all the projects at once, and it is not fragmented and easier for me to manage

You already noted yourself: using one repository won't allow you to take properly advantage of tags and it will be hassle to tell the histories apart.

In my opinion it achieves quite the opposite. It will be harder to manage and to track.

As I see it, different repositories are the superior choice.


You have three different subprojects with more or less different history. If you somehow want to group them submodules might be the way to go, using a "main" repository for the overall project.

This "main" repository can also be used to track your Documents folder.

like image 127
Sascha Wolf Avatar answered Oct 21 '25 22:10

Sascha Wolf


The rule I usually follow is:

  • Code that is branched and released together goes into one repository.
  • Code that is branched and released independently into a separate repository.

This is because in git you cannot branch or tag some part of a repository (like e.g. in Subversion) - branches and tags are always for the whole repo.

So the question is: Do you always release all parts together? Or are they developed and released separately (maybe even with different version numbers)?

like image 31
sleske Avatar answered Oct 22 '25 00:10

sleske



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!