What is the best way to organize multiple projects in GIT?

I evaluate whether it is possible for GIT to organize our projects. We work under Windows with Visual Studio 2010 on the local network.

Our project organization:

We have a common code base (call it SHARE), where all developers are allowed to expand, modify, and fix bugs. All developers have several private projects that depend on a common code base. Thus, the structure:

root
   |
   +-- SHARE
   +-- Project 1 Dev 1
   +-- Project 2 Dev 1
   +-- Project 1 Dev 2

I think that this is one source repository on a network drive with clones on each developer's PC and 1 private repository for each project on the developer's computers (maybe some backups on the network). Some kind of link would be good, so when the developer checks his project, he will get the correct common source. Is this possible with GIT and how?

Or can you recommend a better way?

+3
source share
1 answer

Some kind of link would be good, so that when a developer checks his project he will get the correct general source as well. Is this possible with GIT and how?

Submodules are what you need — they allow you to store a “pointer” to some other repo inside the main repo (“superproject”) with metadata about the exact “state” of the subproject so that everyone works against an agreed-upon common subproject.

The submodule itself can be processed and improved in the same way as any other repository, and the "state" pointer can be updated to a new consistent version when appropriate.

, : "shared", , git submodule init && git submodule update, .

+3

Source: https://habr.com/ru/post/1786321/


All Articles