使用 Git 版本控制查看文件的更改历史记录 [英] View the change history of a file using Git versioning

查看:28
本文介绍了使用 Git 版本控制查看文件的更改历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Git 中查看单个文件的更改历史记录,以及更改内容的完整详细信息?

How can I view the change history of an individual file in Git, complete details with what has changed?

我已经做到了:

git log -- [filename]

它显示了文件的提交历史,但我如何获得每个文件更改的内容?

which shows me the commit history of the file, but how do I get at the content of each of the file changes?

我正在尝试从 Microsoft Visual SourceSafe 过渡,这曾经是一个简单的右键单击 → 显示历史.

I'm trying to make the transition from Microsoft Visual SourceSafe and that used to be a simple right-click → Show history.

推荐答案

对于图形视图,我会使用 gitk:

For a graphical view I'd use gitk:

gitk [filename]

或者按照文件名过去重命名:

Or to follow filename past renames:

gitk --follow [filename]

这篇关于使用 Git 版本控制查看文件的更改历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆