本文为您详细介绍如何使用代码对比功能。
操作步骤
1. 登录 CODING 控制台,单击团队域名进入 CODING 使用页面。
2. 单击团队首页左侧的项目,进入项目列表页,选择目标项目。
3. 选择左侧菜单代码仓库,进入代码仓库首页。
4. 进入指定代码仓库,可单击分支、标签或修订版本(哈希值)进入对应页面。
![](https://qcloudimg.tencent-cloud.cn/image/document/59213643b649f093d8e3688b19ea557c.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/59213643b649f093d8e3688b19ea557c.png)
5. 在对应页面中单击 ![](https://qcloudimg.tencent-cloud.cn/image/document/414552bc4fe6e0816dab96dd24b50bc4.png)
并选择对比。
![](https://qcloudimg.tencent-cloud.cn/image/document/414552bc4fe6e0816dab96dd24b50bc4.png)
以分支列表为例,选择指定分支,单击 ![](https://qcloudimg.tencent-cloud.cn/image/document/7e975a8b903781347e3b0ba37f02ca3d.png)
并选择对比。
![](https://qcloudimg.tencent-cloud.cn/image/document/7e975a8b903781347e3b0ba37f02ca3d.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/732761b0b81f7693d74e6906de194c98.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/732761b0b81f7693d74e6906de194c98.png)
以标签列表为例,选择指定标签,单击 ![](https://qcloudimg.tencent-cloud.cn/image/document/b7e81a9985c286b4aa13e4c17e97857f.png)
并选择对比。
![](https://qcloudimg.tencent-cloud.cn/image/document/b7e81a9985c286b4aa13e4c17e97857f.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/d760707db860a731b6728275197149d4.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/d760707db860a731b6728275197149d4.png)
如果进入了指定的修订版本(哈希值),在右上角单击 ![](https://qcloudimg.tencent-cloud.cn/image/document/9d94cdaee650325ea4eeea135cb25ba3.png)
并选择对比。
![](https://qcloudimg.tencent-cloud.cn/image/document/9d94cdaee650325ea4eeea135cb25ba3.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/7c4c10da61bbdf16b8cc629d448446a2.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/7c4c10da61bbdf16b8cc629d448446a2.png)
6. 在代码对比页面,可选择对应分支、标签或修订版本进行对比。
![](https://qcloudimg.tencent-cloud.cn/image/document/519dc0a2db929c37d243474a05074117.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/519dc0a2db929c37d243474a05074117.png)
功能说明
为保证网页响应速度,若超过 20 个文件存在差异将无法使用全部展开功能。
代码对比功能本质上是
git diff
命令的在线图形化表达。若勾选相对共同祖先的差异选项,那么将展示源分支与共同祖先间提交的差异。![](https://qcloudimg.tencent-cloud.cn/image/document/c2440f2f6b12657d070fb66c832cd9f8.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/c2440f2f6b12657d070fb66c832cd9f8.png)
不勾选相对共同祖先的差异选项将直接展示源分支与目标分支间的对比。
![](https://qcloudimg.tencent-cloud.cn/image/document/5a57d82def9508e01de5df0d48df06b5.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/5a57d82def9508e01de5df0d48df06b5.png)