---
title: "查看项目历史 - 项目和 MQL5 Algo Forge - MetaEditor 帮助"
description: "MQL5 Algo Forge 是一个基于 Git 的版本控制系统。这意味着对被跟踪文件所做的更改可以轻松查看，如有必要，还可以撤销。 右键单击文件/文件夹，然后选择 “Git 日志”。在提交历史对话框中，右键单击相关提交以查看可用选项。 在... - 查看项目历史 - 项目和 MQL5 Algo Forge - MetaEditor 帮助"
image: "https://www.metatrader5.com/i/logo_metatrader5.png"
url: "https://www.metatrader5.com/zh/metaeditor/help/mql5storage/mql5storage_diff"
---

[MetaEditor 帮助](https://www.metatrader5.com/zh/metaeditor/help) → [项目和 MQL5 Algo Forge](https://www.metatrader5.com/zh/metaeditor/help/mql5storage) → 查看项目历史

# 查看项目历史记录

MQL5 Algo Forge 是一个基于 Git 的版本控制系统。这意味着对被跟踪文件所做的更改可以轻松查看，如有必要，还可以撤销。

右键单击文件/文件夹，然后选择 “Git 日志”。在提交历史对话框中，右键单击相关提交以查看可用选项。

![提交上下文菜单](https://www.metatrader5.com/i/help/metaeditor/en/commit_context_menu.png)

## 工作副本与选定修订 [#](#compare_working)

在 [提交的上下文菜单](https://www.metatrader5.com/zh/metaeditor/help/mql5storage/mql5storage_diff#viewing_project_history)中，选择“与工作副本比较” 可将当前文件与特定修订版本进行比较。一个 [窗口](https://www.metatrader5.com/zh/metaeditor/help/mql5storage/mql5storage_diff#diff_window) 将会打开，展示该文件与该修订版本之间的具体差异。

## 当前修订与先前修订 [#](#compare_previous)

在寻找新问题的原因时，你可能需要对最近的变化进行分析。MetaEditor 支持对最新版本和先前版本进行比较。

右键单击最新提交以打开其 [上下文菜单](https://www.metatrader5.com/zh/metaeditor/help/mql5storage/mql5storage_diff#viewing_project_history)，然后选择“与先前版本比较”。一个 [窗口](https://www.metatrader5.com/zh/metaeditor/help/mql5storage/mql5storage_diff#diff_window) 将会打开，显示具体差异。

## 一个修订与另一个修订 [#](#compare_revisions)

比较两个任意修订版本，可以显示检查点之间的累积变化。这使您能够隔离回归错误，并在无需遍历每个中间提交的情况下审核代码。

在 [提交历史记录对话框](https://www.metatrader5.com/zh/metaeditor/help/mql5storage/mql5storage_diff#viewing_project_history)中，按住 Ctrl 键并选择任意两个提交，然后右键单击所选内容并选择“比较修订”。一个 [窗口](https://www.metatrader5.com/zh/metaeditor/help/mql5storage/mql5storage_diff#diff_window) 将会打开，显示确切差异。

## 工作副本与最新修订版 [#](#diff)

要在提交之前查看已修改文件的更改，请右键单击该文件并选择 “Git 差异”。一个显示文件当前状态与其上一版本之间差异的窗口将会打开。

## 窗口显示更改 [#](#diff_window)

当您从 [提交的上下文菜单](https://www.metatrader5.com/zh/metaeditor/help/mql5storage/mql5storage_diff#viewing_project_history)中选择一个选项时，会弹出一个包含多个部分和代码高亮显示的窗口。左侧部分展示的是之前的状态，而右侧部分展示的是最近的修订内容。

高亮显示的代码行的颜色表示更改类型。蓝色高亮部分表示新增内容。

![蓝色高亮显示的代码](https://www.metatrader5.com/i/help/metaeditor/en/blue_code_highlight.png)

绿色高亮部分表示修改内容。

![绿色高亮显示的代码](https://www.metatrader5.com/i/help/metaeditor/en/green_code_highlight.png)

红色高亮部分表示已删除的内容。

![红色高亮显示的代码](https://www.metatrader5.com/i/help/metaeditor/en/red_code_highlight.png)

将光标放在高亮显示的行上，底部区域会一行一行地显示具体的更改内容。

![文件中的代码更改或差异](https://www.metatrader5.com/i/help/metaeditor/en/mql5storage_diff.png)

## 工具栏 [#](#toolbar)

工具栏中提供以下命令：

- ![打开文件比较差异](https://www.metatrader5.com/i/help/metaeditor/en/open_icon.png) ― 选择任意两个文件做 [比较](https://www.metatrader5.com/zh/metaeditor/help/mql5storage/mql5storage_diff#compare_files)。
- ![更新文件](https://www.metatrader5.com/i/help/metaeditor/en/refresh_icon.png) ― 刷新文件，如果您在比较更改时编辑了文件，这将非常有用。
- ![转到上一个差异](https://www.metatrader5.com/i/help/metaeditor/en/arrowup_icon.png) ― 跳转到文件中的上一个更改处。
- ![转到下一个差异](https://www.metatrader5.com/i/help/metaeditor/en/arrowdwon_icon.png) ― 跳转到文件中的下一个更改处。

### 比较两个文件 [#](#compare_files)

除了查看不同提交之间的差异外，MetaEditor 还支持直接比较两个文件。

从工具栏点击“ ![打开文件比较差异](https://www.metatrader5.com/i/help/metaeditor/en/open_icon.png) ”，使用“浏览”按钮选择要比较的两个文件，然后点击 “OK”。

![选择要比较的文件](https://www.metatrader5.com/i/help/metaeditor/en/mql5storage_diff_files.png)

一个新的 [窗口](https://www.metatrader5.com/zh/metaeditor/help/mql5storage/mql5storage_diff#diff_window) 将会打开，展示两个文件之间的逐行差异。

## In this section

- [启用存储](https://www.metatrader5.com/zh/metaeditor/help/mql5storage/mql5storage_connect)
- [创建并操控项目](https://www.metatrader5.com/zh/metaeditor/help/mql5storage/projects)
- [操控存储](https://www.metatrader5.com/zh/metaeditor/help/mql5storage/mql5storage_working)
- 查看项目历史
- [合并修改](https://www.metatrader5.com/zh/metaeditor/help/mql5storage/mql5storage_merging)
- [外部 Subversion 客户端](https://www.metatrader5.com/zh/metaeditor/help/mql5storage/mql5storage_external_client)

```json
{"@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [ {"@type": "ListItem", "position": 1, "item": {"@id": "https://www.metatrader5.com/zh/metaeditor/help", "name": "MetaEditor 帮助"}}, {"@type": "ListItem", "position": 2, "item": {"@id": "https://www.metatrader5.com/zh/metaeditor/help/mql5storage", "name": "项目和 MQL5 Algo Forge"}}, {"@type": "ListItem", "position": 3, "item": {"@id": "https://www.metatrader5.com/zh/metaeditor/help/mql5storage/mql5storage_diff", "name": "查看项目历史"}} ]}
{ "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{ "@type": "Question", "name": "MetaTrader 5: 查看项目历史", "acceptedAnswer": { "@type": "Answer", "text": "MQL5 Algo Forge 是一个基于 Git 的版本控制系统。这意味着对被跟踪文件所做的更改可以轻松查看，如有必要，还可以撤销。 右键单击文件/文件夹，然后选择 “Git 日志”。在提交历史对话框中，右键单击相关提交以查看可用选项。 在 提交的上下文菜单 中，选择“ 与工作副本比较”..." } }] }
```
