How does git cause branching that cannot be feared?

I am new to the Git world, previously working exclusively with a centralized version control mechanism, namely Microsoft's TFS (tfvc). I already read a couple of tutorials, editorials, questions / answers about stackoverflow, and also created a couple of Git repositories that I work in, but haven’t come up with anything yet.

I'm curious why so often I come across a statement like "why I was afraid of branching before, but not with git anymore", or something like that? I will not doubt this statement, I am just looking for the reason why this is so.

From the editorials that I read, and as far as I understand the Git architecture so far, I understand how branching is easy and how easy it is (branches are just pointers to commits), but still there is nothing magical about avoiding merge conflicts, etc. .d. The pattern of conflicts is the same, so why should I, a newbie in the Git world, not be afraid to make many branches, switch between them, commit, merge, etc.?

Until now, I work in a small team, so we have 1/2 people on the project, so there are practically no merge conflicts (no surprises), but say that you have a team of 50 engineers who all work on different parts of the application, and I just can't help but think that this is just a nightmare every time for them, when all these commits start to intersect with each other.

Having a company agreement, like the same IDEs, the same scrolling schemes, etc., everything is fine and good, but it applies to any version control mechanism, right? To finish my short remark and repeat the main question:

"Why shouldn't I worry about working on branches in Git against other version control mechanisms?"

Thank you in advance

+6
source share
4 answers

It depends...

if you have 50 people who merge with one branch, then yes! You may encounter merge and hell collisions with git , with svn , with any tool ( git merge bit more complicated, but it won’t solve it!)

If you connect locally and team up as a "standalone" developer, you have nothing to fear.

Below, this term has been abused. branching and merging is a theoretical concept, and you are absolutely right, no matter what tool you use, branching and merging are all the same abstract concepts that you should be afraid and not afraid - the same with any tool!

The change that git brings is basically that it allows you to branch and merge quickly, either locally or by distributed developers, but then again, if you have 50 people joining the same code base - be afraid - there are many problems with merging really happen git doesn't solve it (there will be a lot of screams here git defenders :)).

The problem here is that we have too many people working on the same code base, and this does not apply to any source code management tool, but to the command structure, as well as to the use of microservices or monolithic design.

+2
source

I myself have worked with Git, SVN, and Mercurial for the past 4 years. I find branching, merging, and switching between branches much easier with Git. This, and I feel that it’s easier to fix conflicts. For SVN and Mercurial, I am sure that there are users who feel the same way that these version control mechanisms are easy to work with, but I would say that 70-80% of the people I worked with were on Git's side.

0
source

On the right, you have nothing to fear from branching in Git. This is one of the strengths of Git. Often people are afraid of this because they never come up with the idea of ​​distributed version control, so the industry concept itself can be intimidating, especially when you are not yet aware of all the tools that simplify their management and support the track.

As for managing a team with Git, this requires a protocol so as not to be insanely tough. This is a good strategy for using Git. This strategy allows everyone to know where they are and what they should work on.

http://nvie.com/posts/a-successful-git-branching-model/

0
source

You can easily combine the changes that several developers made in different parts of the same large text file. Anyone who tried to combine the changes made by different people in one MS Word.doc document would admit that this is a very good feature.

Nothing can help, however, if incompatible changes are made in the same part of the document by different developers. Conflicts must be resolved manually for this case. However, assuming that your 50 developers do not all work on the same single function, successful automatic mergers are frequent enough to intelligently develop industry-specific development.

0
source

All Articles