git difftool — how to skip a certain file?

纵饮孤独 提交于 2020-01-02 05:28:06

问题


when I do a git difftool, I get the message Hit return to launch 'araxis':. I found out that I can terminate the whole diffing by pressing CTRL-C, but how about skipping a single file?

Is this possible?


Edit: as of git 1.7.7.1 (and msysgit 1.7.7.1.msysgit.0), it is possible. For every file, I get asked

Launch 'araxis' [Y/n]:

Seems like peterjmag's commit mentioned in his answer was accepted by the git guys and has made it's way into the master branch!


回答1:


As eckes requested in the comments above:

While it doesn't "skip" files per se, this git-diffall script (spawned by this SO answer) opens each file in windows/tabs in your diff tool, and then you can ignore certain files from there. However, I agree that there should be an option to skip a certain file from the prompt, i.e. "Hit return to launch 'araxis' or type 's' to skip this file: "

EDIT: Since this functionality would be helpful to me as well, I forked git.git on github and added it myself. Check out this (very simple) commit for a proof of concept. I'll be submitting a patch to the git mailing list as well, in hopes that someone can suggest a better approach--preferably someone who's better at shell scripting than me. :-)

I'm also open to feedback via GitHub's built-in notes system!

ANOTHER EDIT: It appears that this functionality is now in git core as of v1.7.7.1 or so (October 2011). Here's the relevant commit on GitHub.



来源:https://stackoverflow.com/questions/4387708/git-difftool-how-to-skip-a-certain-file

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