How do I use tig to view the diff for a file which is changed but not commited?

我是研究僧i 提交于 2019-12-23 17:09:23

问题


In git, it is git diff <file path>, but what about in tig?

In tig, in the status view, highlighting a file (staged or unstaged) and pressing D, diffs the last commit. I think it should diff the uncommitted file against the last committed version of that file.


回答1:


As a hack, you can do git diff <file path> | tig and see it.

On the status section in tig you can see both the staged and unstaged changes (say, git diff vs git diff --cached) pressing Enter over the file in each of the sections it appears (under "Changes to be committed" or "Changed but not updated").

It may be a nice feature to just tig diff -- <file path> but, well - go ahead, code it :)



来源:https://stackoverflow.com/questions/20574270/how-do-i-use-tig-to-view-the-diff-for-a-file-which-is-changed-but-not-commited

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!