如何管理代码在git上与多个用户合并? [英] How to manage a code merges on git with multiple users?

查看:86
本文介绍了如何管理代码在git上与多个用户合并?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Git不会让一个推送具有合并冲突的分支.在我们目前的情况下,大约有15个冲突的文件,其中一些是我的代码,而另一些是其他人的代码.最好是每个更改代码的人都对那些特定文件执行合并.我们所有人都如何处理自己的文件以完成合并?

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

除了让我们所有人都坐在同一台计算机上,甚至通过Tmux在同一终端上坐下来,每个人都如何对自己负责的文件执行合并?我对 bar.py 一无所知,而杰夫对 foo.py 的工作原理一无所知.

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.

推荐答案

此要点可以,我相信,你想要什么.基本上,您与-no-ff --no-commit 合并,解决冲突,然后 reset head 取消添加合并的内容,然后 add 只是您想要的东西.

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.

这篇关于如何管理代码在git上与多个用户合并?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆