Git with many developers

I am trying to figure out how to work with more than 1 developer in a git repository. Let me explain how we worked so far.

We have 3 developers working on the same project, for example dev1, dev2 and dev3. The master branch is on the git server, and this is checked, what we do when the developer first clones the repo, he creates a new branch that allows you to say branch-dev1 on his local machine, and he works on this branch. And when everything looks stable, he pushes his branch to the central repo. Therefore, its branch-branch-dev1 is available on a centralized server. The project manager then combines his clip to the master branch and resolves the conflict, if any. Like dev2, dev3 pushes its branches branch-dev2, branch-dev3, and again their branch is merged and conflicts are resolved, if any. Then the next day, each of them pulls his head from a centralized server and receives commits from other developers. And they work in iterations.

What I want to know is this correct?

+4
source share
2 answers

It is important to know what upstream means using DVCS.
See " Definition of" downstream "and" upstream " .
Once you know this, you realize that you can have many upstreams repositories .

You describe only one of the possible workflows as described in the Distributed Workflows (Pro Git book) section:

centralized distributed workflow

This is not the only one (as shown on the rest of the Pro Git page), and does not prevent dev1 from registering dev2 repo as a new upstream (remote) repo and retrieving directly from there. <w> However, if three developers are working on the same "development effort", they should work (or at least click on ) the same branch : see " When should you join? "
Remember that with DVCS (Distributed VCS), the concept of branching is orthogonal to publishing (push / pull) .

+2
source

One of the confusing things about git is that there is no “right approach”.

Git is a DVCS. It can also be called "workflow tools." This allows you to customize and create any workflow for you.

If sharing the main development line with the developer makes sense for your organization, then do it. There are also no problems with several developers working in the same “development” unit. Or with separate small branches for individual functions that each developer is working on.

+3
source

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


All Articles