How to manage multiple user git merge code?

Git will not allow pushing a branch with a merge conflict. In our current situation, there are ~ 15 conflicting files, some of which are my code and some of which are other people's code. It is preferable that every person who changes the code merges on those specific files. How can we work with our own files to complete the merge?

Unmerged paths:
    both modified:   foo.py        # This I should fix
    both modified:   bar.py        # This Jeff Atwood should fix
    both added:      bin/baz.py    # This Joel Spolsky should fix 
    both added:      bin/buzz.py   # This I should fix

      

Besides the fact that we are all sitting on the same computer, or even the same terminal via Tmux, how can anyone perform file merging, which is their responsibility? I don't know anything about bar.py

, and Jeff doesn't know anything about how it works foo.py

.

+3


source to share


2 answers


This sense , I believe what you want. Basically, you merge with --no-ff --no-commit

, resolve conflicts, and then reset head

to unlock the merged files, and then add

only the things you want.



+2


source


There is a tool for resolving conflicts here, and after resolving conflicts, you can merge that particular file. Use the command "git mergetool"

to find the difference between the files and choose which one to save. Here is the documentation for that git-mergetool .



After resolving all conflicts, you can merge the branches.

-2


source







All Articles