How to structure multiple projects in Git

Asked

Viewed 656 times

3

At the company where I work, we use Visual Studio 2013 and TFVC for versioning the projects.

I’m used to the Source Control Explorer, be able to give Get Latest Version at any level (the entire repository, a group of projects, just a project or a specific file), create Branch and clearly see the "folder" created with the new branch, etc.

The structure of the projects was organized as follows:

- Repositório
  -- Grupo_de_Projetos_1
     --- Projeto_1
         ---- Development
              ----- Source
                    ...
         ---- Main
              ----- Source
                    ...
         ---- Release
              ----- Source
                    ...
      --- Projeto_2
          ...
      --- Projeto_3
          ...

  -- Grupo_de_Projetos_2
    --- Projeto1
        ...

Basically with this structure it was possible to authorize access to the entire repository, to a group of projects or even to just one specific project. Each project was organized in 3 Branchs (Development, Main and Release), all just an exact copy. So the developers worked on Development and then we could do the Merge in Main to then send to Release. So when a bug in production, we resolve directly in Release, we publish and then replicate the correction for others Branchs, and the game follows.

Now it’s been decided to move to Git, and I’ve been responsible for the migration, but I’m having trouble putting together the folder structure (I can already understand the commands and many concepts used).

Looking at my old structure on TFVC, would it be possible to create something similar? (I know that the Branchs will no longer be seen in the same way).

Let’s go to Checklist:

  1. I already have my repository created, so it would be equivalent to my first level of the structure shown earlier (-)?
  2. Would my Group_de_projects_1 (-) be a "subrepository" or simply a folder? It would be possible to configure access levels to a folder?
  3. Each (---) project would be a "subrepository" as well, in order to create the Branchs or simply a folder? It is possible to create a folder Branch only for a folder?

I saw a little bit about submodule, would perhaps be an option in this context?

I was also in love with this tip from Microsoft, could be implemented with Git?

  • Interesting question - I believe that each project should have its repository right (is there such a subrepository?) - I believe that a simple folder in a "huge" repository does not make sense for different projects, especially at the time of cloning the repository and receiving a lot of files from another project together.

  • And you know this here, right? D

  • I didn’t know no @Blogger thanks so much for sharing, it’s been a great read. (Answering the question from the subrepository, the closest I found was the submodule, but I don’t know if it’s him I should sweat in this case)

1 answer

2


  1. Yes, the repository would be the equivalent of its first level

  2. No! In Git you have access to the entire repository, you can’t just download a folder.

  3. I see no reason for you to divide projects into repositories or sub-repositories, if they are part of the same Solution, the complexity would only increase. However, the use of module is interesting if you have a modular architecture, for example, an e-commerce and that in each module of the application stay in the performance of a team, sales, inventory, etc... You could download only application module pertaining to your work.

You can structure the folders in Git like this tip from the Microsoft page you quote. Normally I do:

  • \
  • src
  • doc
  • README.MD

and within src (source), I place the structure of Solution, normally AS IS as created by Visual Studio.

  • Thank you so much for the answer! Point 3 really is my case, we have a modular architecture, and we separate each module into a Solution. From the looks of it, my Project Group would be my repository, and I could split each project into a Git module.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.