My organization created a private GitHub repository for us to store our source files, documentations and various other bits and pieces. BY "us", I mean two people (for now), me and another one of our team members. How should we sync our work so that we don't get any conflicts? As we can't fork the repo, the flow isn't being very clear to me. I thought of both creating a separate branch of our own and then opening a PR to the master branch, whenever necessary. Is there any other way to handle this more efficiently?
Asked
Active
Viewed 46 times
1
-
1Another good option would be, the owner can have a separate branch and the collaborators can have a fork of the repo. Both in your and my option at some point a conflict could be possible and it is impossible to say that there is a method to achieve your goal where there would be no conflicts. – Deshan Koswatte Jun 25 '20 at 04:44
1 Answers
0
You don't need a fork to "avoid conflict".
Or even branches.
The only way to be sure and have no conflict is a good inter-team communication, in order for each collaborator to work on different files.
That way, you can push without conflict.
You might have to git pull --rebase
before your push if your colleague has already pushed first on the same branch, but if you have modified different files, you won't get any conflict there.
(see also "Can “git pull
” automatically stash and pop pending changes?")
Once your team grows, and the topics become more inter-related, then yes, branches or fork can help.

VonC
- 1,262,500
- 529
- 4,410
- 5,250