如何查看提交中的文件内容 - 如 `git show`
How to view file contents as it was in a commit - Like `git show`
简要说明:SourceTree 等价于什么:
git show 946a759:File.h
更彻底:
File.h 在提交 946a759 中没有更改,我只想查看文件当时的内容犯罪。
我知道我 可以 更改日志视图 - 工作副本视图以显示 所有 我的文件, 在列表中找到文件,右键单击它并选择 "Log Selected",找到提交(或下一个最旧的)但是
- 这是一个繁琐的过程
- 我不想更改日志视图的设置以显示所有文件
- 真的很难在那么长的文件列表中找到一个随机文件。
所以我想做的是在日志视图中,在左侧栏中选择我的主分支,在树中找到特定的提交,然后执行相当于 git show rev:AnyFileIWant。我只要输入文件路径就好了。
我好像找不到办法做到这一点?
Atlassian 说这是不可能的。
I don't think we have something similar available on sourcetree. However, you can select the given file in a commit and from the contextual menu click on "Log Selected" to see all the various modifications of that given file. Thought this doesn't exactly do the same as what you need, if you have an idea of the date of modification, you can figure out which version to look at.
这在 SourceTree 中是不可能的,但是您的 IDE 可能能够做到:
IntelliJ IDEA(以及其他带有集成 VCS 的 JetBrains IDE)
Right-click 您在 VCS 视图中的提交 (alt + 9) 和 select 在修订时显示存储库.
存储库视图将在您的项目视图所在的位置弹出。您现在可以在修订/提交时打开任何文件。文件是 read-only.
简要说明:SourceTree 等价于什么:
git show 946a759:File.h
更彻底:
File.h 在提交 946a759 中没有更改,我只想查看文件当时的内容犯罪。
我知道我 可以 更改日志视图 - 工作副本视图以显示 所有 我的文件, 在列表中找到文件,右键单击它并选择 "Log Selected",找到提交(或下一个最旧的)但是
- 这是一个繁琐的过程
- 我不想更改日志视图的设置以显示所有文件
- 真的很难在那么长的文件列表中找到一个随机文件。
所以我想做的是在日志视图中,在左侧栏中选择我的主分支,在树中找到特定的提交,然后执行相当于 git show rev:AnyFileIWant。我只要输入文件路径就好了。
我好像找不到办法做到这一点?
Atlassian 说这是不可能的。
I don't think we have something similar available on sourcetree. However, you can select the given file in a commit and from the contextual menu click on "Log Selected" to see all the various modifications of that given file. Thought this doesn't exactly do the same as what you need, if you have an idea of the date of modification, you can figure out which version to look at.
这在 SourceTree 中是不可能的,但是您的 IDE 可能能够做到:
IntelliJ IDEA(以及其他带有集成 VCS 的 JetBrains IDE)
Right-click 您在 VCS 视图中的提交 (alt + 9) 和 select 在修订时显示存储库.
存储库视图将在您的项目视图所在的位置弹出。您现在可以在修订/提交时打开任何文件。文件是 read-only.