Search code examples
gitconflict

Git - resolve conflicts partially and send changes to somebody else to finish solving


I would like to know if there is a way to solve some conflicts (caused by merge or rebase) and send it to another person who will solve the rest of conflicts. It sometimes happens, eg. you work on a branch you derived and when it comes to merging it may me better if the person responsible for merging those particular changes is the author of them. Or if you need few changes in stylesheets and ask design team to do them so you can finish your work and then you have conflicts in stylesheets you have never touched.


Solution

  • The conflicts are being resolved locally on your repo. You would have to provide the other individual access to your local directly (sitting at your machine, copying the files to a usb, etc). You can't resolve some conflicts and leave the rest for someone else to resolve (I can see that leading to conflicts not being resolved as everyone points figures at someone else) There is not internal feature to git for handling this situation, you will have to consult the person responsible or make a judgement yourself.

    If you only need some files from the repo, you can do git checkout <branch-name> -- <file1> <file2> and then update those files. But this can still lead to conflicts and confusion about who made what change when your branch gets merge back in.

    For the most part, keeping your project branch up-to-date with regular merges/rebases should minimize the conflicts when you are requesting changes. But once you have a conflict, you will need to resolve it in some way.

    If the file is one that you never touched you can just checkout the file from the branch that you are rebasing/merging and take the changes from that.

    git checkout <merging-branch> -- <conflicted file>