gpt4 book ai didi

git - 无法在 Git 的两个独立分支中区分文件

转载 作者:IT王子 更新时间:2023-10-29 00:39:38 26 4
gpt4 key购买 nike

我在 branchA 中有 FileA,在 branchB 中有 FileB。

问题是我一次只能访问一个文件。我希望能够通过 FileMerge 或 meld 比较文件,因为它们是我为 Mac 找到的唯一 diffTools。

如何通过 meld/FileMerge 区分这两个文件


[已解决]:第一个开发问题:FileMerge 不允许标准输入

Masi: You can use opendiff to allow FileMerge to have files from standard input. So the next problem is to find how to make git's diff tool to use opendiff.


第二个开发问题:让Git的diff工具在Mac中使用opendiff

最佳答案

您可以使用“git mergetool”进行 merge ,在现代 git(表示 1.6.3 及更高版本)中,“git difftool”用于使用图形工具进行比较。当然,您必须先配置它们,但它们会进行一些自动检测(当然有一些硬编码的偏好),如果我没记错的话,opendiff 支持是内置的。

然后您当然可以像使用普通的“git diff”一样使用您的图形工具(opendiff/FileMerge)

prompt> git difftool somebranch:UNREADME otherbranch:README

关于git - 无法在 Git 的两个独立分支中区分文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/916822/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com