Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to manage a code merges on git with multiple users?

Git will not let one push a branch that has 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 each person who changed code perform the merge on those particular files. How can we all work on 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

Other than having us all sit down at the same computer, or even at the same terminal via Tmux, how can each person perform the merge on the files which are his responsibility? I know nothing about bar.py, and Jeff knows nothing about how foo.py works.

like image 997
dotancohen Avatar asked Sep 08 '14 06:09

dotancohen


1 Answers

This gist does, I believe, what you want. Basically, you merge with --no-ff --no-commit, resolve conflicts, then reset head to un-add the merged stuff, then add only the things you want.

like image 75
Amadan Avatar answered Nov 07 '22 09:11

Amadan