git difftool -- 如何跳过某个文件?

发布于 2024-10-06 23:36:49 字数 548 浏览 3 评论 0原文

当我执行 git difftool 时,我收到消息 Hit return to launch 'araxis':。我发现我可以通过按 CTRL-C 来终止整个比较,但是跳过单个文件怎么样?

这可能吗?


编辑:从git 1.7.7.1(和msysgit 1.7.7.1.msysgit.0)开始,这是可能的。对于每个文件,我都会被问到

Launch 'araxis' [Y/n]:

似乎 peterjmag 的 提交在他的 答案已被 git 人员接受,并已进入 master分支!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

十年不长 2024-10-13 23:36:50

正如埃克斯在上面的评论中所要求的:

虽然它本身并不“跳过”文件,但这个 git-diffall 脚本 (由 这个 SO 答案) 在 diff 工具的窗口/选项卡中打开每个文件,然后您可以从那里忽略某些文件。但是,我同意应该有一个选项可以从提示中跳过某个文件,即“按回车键启动 'araxis' 或输入 's' 跳过此文件:”

编辑:因为这个功能对我也很有帮助,我在 github 上分叉了 git.git 并自己添加了它。查看这个(非常简单)提交以获得概念证明。我也会向 git 邮件列表提交一个补丁,希望有人能提出更好的方法——最好是比我更擅长 shell 脚本编写的人。 :-)

我也愿意通过 GitHub 的内置注释系统提供反馈!

另一个编辑:看来这个功能现在已经在 git core 中,从 v1.7.7.1 左右(2011 年 10 月)开始。 这是 GitHub 上的相关提交

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文