How to view complete commits when tracking history of a single file in Git?

喜你入骨 提交于 2019-11-30 11:08:44
iamamac

In the command line,

git log -p --full-diff file.txt

will output what you want.

If you must see it in gitk, invoke it with no arguments, find commit "touching path" file.txt, and the commit contains that file will be bold. And you can use the "up" and "down" buttons to traverse through it.

You can actually have '--full-diff' functionality in gitk, just not directly from the command line. Just do the following:

  • Start gitk the usual way, e.g.: gitk file.txt
  • Select 'View -> Edit view...' from the menu. Verify that you are editing the 'Command line' view.
  • In the edit box next to "Additional arguments to git log", type --full-diff
  • Click "Apply" or hit [F5].

That should do it. Why gitk doesn't allow you to use this from the command line is a mystery to me, for it is a very useful option.

Another solution from the mailing list dated far back in 2008:

Try turning off the option "Limit diffs to listed paths" in the preferences menu (or adding "set limitdiffs 0" to your ~/.gitk).

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