【问题标题】:Git diff with a sub-directory in the remoteGit diff 与远程中的子目录
【发布时间】:2023-03-29 07:01:01
【问题描述】:

我在本地的 git 存储库(例如,a)是另一个 git 存储库(例如,b)的子目录。我的目标是检查我的文件与远程b 的匹配子目录中的文件之间的差异。我知道子目录的路径(比如subdir/)。如何获得所需的差异?

我试过了, git diff master <a remote commit> -- subdir/ 但它仍然将我本地的sample.txt 和远程bsubdir/sample.txt 视为不同的。我能做些什么来实现所需的差异?另外,如果我也不知道子目录位置怎么办?

【问题讨论】:

    标签: git git-diff


    【解决方案1】:

    我想通了,

    git diff master <a remote commit>:subdir

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-16
      • 2021-04-15
      • 1970-01-01
      • 2012-09-10
      相关资源
      最近更新 更多