Github /比较:如何区分两个不同的文件(不同的文件名,都在HEAD中)? [英] Github/compare: How to diff two different files (different file names, both in HEAD)?

查看:339
本文介绍了Github /比较:如何区分两个不同的文件(不同的文件名,都在HEAD中)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用github / compare比较来显示HEAD中两个不同源文件之间的差异吗?



下面是我在命令行中如何使用 git diff
$ b


git diff HEAD:docs / tutorial / 01-boxed-function-pointers.cpp HEAD:docs / tutorial / 02-raw-actors.cpp


我对github语法的最佳猜测如下。但它不起作用:



https://github.com/RossBencina/Fractorp/compare/HEAD:docs/tutorial/01-boxed-function- pointers.cpp ... HEAD:docs / tutorial / 02-raw-actors.cpp



我特别想要一个在线漂亮的HTML呈现的差异。

如果用github不能完成这项工作,任何人都可以推荐一个第三方网站,它可以呈现两个任意文件在github上的差异吗?



编辑#1:



感谢那些推荐 https://www.diffchecker.com 。但是,我需要能够将源文件指定为github上的当前HEAD。任何第三方工具都需要自动从github repo网址中提取最新的源文件。我注意到 http://www.mergely.com 可以从URL导入源文件。然而,我正在寻找一个总是使用最新HEAD的实时视图。



谢谢。

解决方案

我一直在使用这个第三方在线比较工具很长一段时间,如果你喜欢,你也可以使用它。 https://www.diffchecker.com 。但似乎你应该手动将两个文件粘贴到它上面。

Can I use the github /compare to display the difference between two different source files in HEAD?

Here is how I do it on the command line with git diff:

git diff HEAD:docs/tutorial/01-boxed-function-pointers.cpp HEAD:docs/tutorial/02-raw-actors.cpp

My best guess at the github syntax is the following. But it doesn't work:

https://github.com/RossBencina/Fractorp/compare/HEAD:docs/tutorial/01-boxed-function-pointers.cpp...HEAD:docs/tutorial/02-raw-actors.cpp

I specifically want an on-line pretty-printed HTML render of the diff.

If this can't be done with github, can anyone recommend a third-party website that will render diffs of two arbitrary files hosted on github?

Edit #1:

Thanks to the answers who recommended https://www.diffchecker.com. However, I need to be able to specify the source files as current HEAD on github. Any third-party tool would need to automatically pull the latest source files from github repo URLs. I notice that http://www.mergely.com can import source from URLs. However I am looking for a live view that always uses the latest HEAD.

Thank you.

解决方案

I have been using this third party online diff tool for a long time, if you like, you can use it as well. https://www.diffchecker.com. But it seems you should manually paste the two files onto it.

这篇关于Github /比较:如何区分两个不同的文件(不同的文件名,都在HEAD中)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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