如何在 Visual Studio Code 中查看 Git 历史记录?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37899765/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:17:00  来源:igfitidea点击:

How can I view the Git history in Visual Studio Code?

gitvisual-studio-codeidegit-history-graph

提问by rlesias

I can execute various Git commands from Visual Studio Code, however I couldn't find a way to visualize the history.

我可以从 Visual Studio Code 执行各种 Git 命令,但是我找不到可视化历史的方法。

采纳答案by ThormaWeb.com

I recommend you this repository, https://github.com/DonJayamanne/gitHistoryVSCode

我向你推荐这个存储库,https://github.com/DonJayamanne/gitHistoryVSCode

Git HistoryGit History

Git 历史Git 历史

It does exactly what you need and has these features:

它完全满足您的需求,并具有以下功能:

  • View the details of a commit, such as author name, email, date, committer name, email, date and comments.
  • View a previous copy of the file or compare it against the local workspace version or a previous version.
  • View the changes to the active line in the editor (Git Blame).
  • Configure the information displayed in the list
  • Use keyboard shortcuts to view history of a file or line
  • View the Git log (along with details of a commit, such as author name, email, comments and file changes).
  • 查看提交的详细信息,例如作者姓名、电子邮件、日期、提交者姓名、电子邮件、日期和评论。
  • 查看文件的先前副本或将其与本地工作区版本或先前版本进行比较。
  • 在编辑器 (Git Blame) 中查看对活动行的更改。
  • 配置列表中显示的信息
  • 使用键盘快捷键查看文件或行的历史记录
  • 查看 Git 日志(以及提交的详细信息,例如作者姓名、电子邮件、评论和文件更改)。

回答by Joseph Sheedy

GitLenshas a nice Git history browser. Install GitLens from the extensions marketplace, and then run "Show GitLens Explorer" from the command palette.

GitLens有一个不错的 Git 历史浏览器。从扩展市场安装 GitLens,然后从命令面板运行“显示 GitLens Explorer”。

回答by arkhwise

I would recommend using Git Graphextension.

我建议使用Git Graph扩展。

回答by prosti

It is evident to me that GitLensis the most popular extension for Git history.

很明显,GitLens是 Git 历史上最受欢迎的扩展。

enter image description here

在此处输入图片说明

What I like the most it can provide you side annotations when some line has been changed the last time and by whom.

我最喜欢的是它可以在上次更改某些行时以及由谁更改时为您提供旁注。

Enter image description here

在此处输入图片说明

回答by VonC

You won't need a plugin to see commit history with Visual Studio Code 1.42or more.

你不需要插件来查看Visual Studio Code 1.42或更高版本的提交历史记录。

Timeline view

In this milestone, we've made progress on the new Timeline view, and have an early preview to share.
This is a unified view for visualizing time-series events (e.g. commits, saves, test runs, etc.) for a resource (file, folder, etc.).

To enable the Timeline view, you must be using the Insiders Editionand then add the following setting:

"timeline.showView": true

时间线视图

在这个里程碑中,我们在新的时间轴视图方面取得了进展,并有一个早期的预览可以分享。
这是用于可视化资源(文件、文件夹等)的时间序列事件(例如提交、保存、测试运行等)的统一视图。

要启用 Timeline 视图,您必须使用Insiders Edition,然后添加以下设置:

"timeline.showView": true

https://media.githubusercontent.com/media/microsoft/vscode-docs/vnext/release-notes/images/1_42/timeline.png

https://media.githubusercontent.com/media/microsoft/vscode-docs/vnext/release-notes/images/1_42/timeline.png

回答by Tobias Otto

You will find the right icon to click, when you open a file or the welcome page, in the upper right corner.

当您打开文件或欢迎页面时,您会在右上角找到要单击的正确图标。

Enter image description here

在此处输入图片说明

And you can add a keyboard shortcut:

您可以添加键盘快捷键:

Enter image description here

在此处输入图片说明

回答by Joe Phillips

Git Graphseems like a decent extension. After installing, you can open the graph view from the bottom status bar.

Git Graph似乎是一个不错的扩展。安装后,您可以从底部状态栏打开图形视图。

回答by KRISHNA

If you need to know the Commit history only, So don't use much Meshed up and bulky plugins,

如果你只需要知道 Commit 历史,那么不要使用太多的 Meshed 和笨重的插件,

I will recommend you a Basic simple plugin like "Git Commits"

我会向你推荐一个基本的简单插件,比如“Git Commits”

I use it too :

我也用它:

https://marketplace.visualstudio.com/items?itemName=exelord.git-commits

https://marketplace.visualstudio.com/items?itemName=exelord.git-commits

Enjoy

享受