当前位置:网站首页>传智教育 | 多人协作开发出现代码冲突,如何合并代码?
传智教育 | 多人协作开发出现代码冲突,如何合并代码?
2022-06-23 06:36:00 【传智教育】
1.解决思路
其实解决思路就是小智(程序员A)在提交自己修改的代码之前重新拉取下远程服务器的代码也就是小黑(程序员B)新新修改的代码,然后小智选择性进行合并和废弃代码,然后将修改的后的代码重新commit并推送到远程服务器端。

2.动手实践
制造冲突:假设小黑将自己修改的代码推送到远程服务器上,这里我们在远程服务器上直接修改。

2.1基于Idea工具解决
【1】小智在idea中进行拉取


【2】这时候弹出窗口,需要手动进行合并



【3】先commit

【4】然后提交到远程仓库


【5】远程仓库结果

2.2基于Git命令解决
【1】克隆项目

【2】制造冲突
假设小黑将自己修改的代码推送到远程服务器上,这里我们在远程服务器上直接修改。

【3】小智拉取到本地

【4】查看冲突文件

【5】解决冲突
1.手动修改冲突文件,实际开发中当修改完冲突之后需要通知他人。

2.将修改的内容进行添加、提交、推送

3.远程服务器效果
边栏推荐
- 306. Addenda
- GINet
- TensorFlow中的数据类型
- 【AI实战】机器学习数据处理之数据归一化、标准化
- 【AI实战】xgb.XGBRegressor之多回归MultiOutputRegressor调参2(GPU训练模型)
- 303. region and retrieval - array immutable
- Analysis of personalized learning progress in maker Education
- [AI practice] xgbgressor model accelerates training and uses GPU to train xgbgressor in seconds
- 20220621 Dual Quaternion
- NPM download error NPM err code error
猜你喜欢

In depth learning series 46: face image super score gfp-gan

对二进制的某一位操作

20BN-Jester完整数据集下载

SimpleDateFormat 线程安全问题

用户态和内核态

Traversal of binary tree and related knowledge

406 double pointer (27. remove elements, 977. square of ordered array, 15. sum of three numbers, 18. sum of four numbers)

MySQL (VIII) - explain

20220621 Dual Quaternion

Nacos适配oracle11g-修改Nacos源码
随机推荐
MySQL transaction isolation level
对二进制的某一位操作
How flannel works
306. Addenda
Technical article writing guide
细说Idea那些骚操作
315. calculate the number of elements on the right that are smaller than the current element
897. incremental sequential search tree
paddle版本问题
407-栈与队列(232.用栈实现队列、225. 用队列实现栈)
300. longest increasing subsequence
Akamai-1.75 version-_ Abck parameter generation JS reverse analysis
20BN-Jester完整数据集下载
Akamai-1.75版本-_abck参数生成-js逆向分析
char和varchar区别
User mode and kernel mode
Mysql(十一) — MySQL面试题整理
如何达到高效的网络信息传播
如何优雅的快速下载谷歌云盘的大文件 (二)
异构交易场景交互流程及一致性保证
