Answer the question
In order to leave comments, you need to log in
How to avoid conflicts in git?
There is a main repository with one file.
Several developers fork this repository and start making changes to their copies.
After that, they send their pull requests to the main repository.
But from the moment when one sends a pull request, someone else has already managed to make changes to this file in the main repository.
And because of this, conflict arises.
I don't want to do it manually every time.
Advise how to solve the problem?
(the file cannot be split into several)
Answer the question
In order to leave comments, you need to log in
It's not up to you to decide, the developer, before making a pull request, must make it in his branch
git fetch
git rebase origin/master
If you were sent a pull request with a conflict - send it back, the developer must redo it.
If conflicts are constantly pouring in, this is a reason to reconsider the work, or the pull requests are very large, or the code is mixed into noodles so that each change affects many areas, or the tasks are such that developers make changes in the same place.
This needs to be found out and corrected.
Show the file. Although, in general, it is worth organizing the work somehow. For example, tell developers to work on one atomic unit at a time.
For example, only 1 function was changed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question