Hello, I’m a beginner user so I dont fully understand this.
When reading about git/github about working in groups, everybody tells you than only people who dont know hwat they are doing work directly on the master branch and that you should branch to develop further features everytime you can to avoid conflicts, but I dont understand why doing that would avoid any conflicts, the way I see it there will be the same amount of conflicts no matter how you do that. I’ll give an example.
Lets say we have 2 people working on a project. The master branch has a simple text file with just a line of code wich says “Hello”. If we use the branching method, both people each create a branch, branch A and branch B. The guy on branch A adds a second line to the code wich says “Bye” and merges it to the master. Then the guy on branch B adds a second line of code wich says “Goodbye” and tries to merge it. A conflict would appear since they are both editing line 2 and he would have to resolve it and then do the merge. So this workflow would result in 1 conflict.
Now lets just work on the master branch. Guy A commits with the second line that says “Bye”. When Guy B adds his second line that says “Goodbye” and tries to commit this should also result in a conflict that he would have to resolve.
So if it is the same for both scenarios, why is working in branches suposed to be better?