【问题标题】:Can I compare a file from a Git branch with the same file of another Git branch in Sublime我可以将来自 Git 分支的文件与 Sublime 中另一个 Git 分支的相同文件进行比较吗
【发布时间】:2019-05-20 05:37:06
【问题描述】:

与 Sublime 中另一个 Git 分支的相同文件相比,有没有办法查看文件中的更改?我的意思是如果有类似于 PhpStorm 的Compare with Branch 命令的东西。

提前致谢。

【问题讨论】:

  • 看来 git 会在下一个版本 v2.22.0 中引入 Sublime Merge “smerge”。至于现在,请先安装包Sublimerge 3,然后再查看此答案,stackoverflow.com/a/23528969/6330106git difftool branch_foo branch_bar -- file_baz 将调用 diff 工具。
  • 您可以将两个分支相互比较,然后查找有问题的文件以查看两者之间的不同之处。我不确定您是否可以仅针对单个文件执行此操作(因为您正在比较提交)。

标签: git phpstorm sublimetext3


【解决方案1】:

正如@ElpieKay 所说,这对我有帮助:

git difftool branch_foo branch_bar -- file_baz

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-01-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-13
    • 2023-04-01
    相关资源
    最近更新 更多