How to find diff in a specific file on git using w

2020-07-18 11:31发布

问题:

I know for Git Bash, you can use this command:git diff [--options] [--] [...] but I want to know if there is any way to find difference between a specific file using browser.

Like we can find changes in commits, but that includes all files (https://github.com/github/linguist/compare/c3a414e..faf7c6)

I just want to find changes to one specific file.

回答1:

You can at least (through the browser) see commits which actually involved a given file.
For that, you need to access the "History" page of said file:

https://github.com/github/linguist/commits/master/lib/linguist/heuristics.rb

But that does not give you any diff between two commits.

Another workaround is at least to get to the blame view of that file.

https://github.com/github/linguist/blame/master/lib/linguist/heuristics.rb

For any diff shown here, you can click and see the previous revision information for that line, including who committed the change and when.



标签: git github