
开发A操作:
git commit -am"修改了mytest2,A操作"
git push -u gitee_mygit1 master

开发B操作:
git commit -am"修改了mytest2,B操作"
git push -u gitee_mygit2 master

开发B的push操作出现错误:

因为此时开发B的本地git仓库和远端git仓库有差异
开发B先将远端git仓库pull下来
git pull gitee_mygit2 master
接下来会弹出

保存后退出即可
开发B查看本地文件情况
git log
显示:
Merge: dfsfdsaggfdhsgfhgd51dsagf
Author: mygit2 <mygit2@163.com>
Date: Tue Oct 20 10:42:27 2020 +0800
Merge branch 'master' of https://....... #这里指开发B本地git仓库合并了远端git仓库
commit fca6dsafdsafdsgf2ec1hgfhg5ce7315b564584568
Author: mygit1 <mygit1@163.com>
Date: Tue Oct 20 10:13:58 2020 +0800
修改了mytest2,B操作 #这里是A操作的commit中的message
commit fca6855jhfdsgfdgfgec1hgfhg5ce7315b564584568
Author: mygit1 <mygit1@163.com>
Date: Tue Oct 20 10:13:58 2020 +0800
修改了mytest2,A操作 #这里是A操作的commit中的message
cat mytest2
显示:
qwer
qwer
AAAAA
qwer
123456
git会自动将两边的内容融合起来
开发B再进行push即可
git push -u gitee_mygit2 master