therainismeGit 多人协作开发常见问题与解决方案 中发帖

多人协作开发时,Git 使用不当很容易踩坑:冲突解决不了、误删别人代码、提交历史乱成一团等等等。所以今天为佬们整理了团队开发中最常遇到的问题和实战解决方案。 
场景一:代码冲突了怎么办?
多人同时修改同一个文件,git pull 或 git merge 时就会遇到冲突。这是团队开发中最常见的问题。
情况 1:Pull 时发生冲突
当你执行 git pull 时提示冲突:
$ git pull
Auto-merging src/utils.js
CONFLICT (content): Merge conflict in src/utils.js
Automatic merge failed; fix conflicts and then commit the result.

解决步骤:

查看冲突文件

git status

标记为 both modified 的文件就是冲突文...