如何检查提交内容仍然存在?

时间:2017-01-18 08:20:37

标签: git compare comparison commit

如何验证来自例如现有提交的内容去年还没变? 我有10个具有相同标记的提交,其内容可能丢失或被覆盖。现在我需要将当前内容与旧提交进行匹配,以验证是否有更改。

1 个答案:

答案 0 :(得分:1)

比较两个commit/branch并查看是否存在任何差异。

$ git fetch
$ git log                           # copy the commit hash

$ git diff HEAD..<commit>           # shows what is in the commit that is not in HEAD   
$ git diff <commit-1> <commit-2>    # diff of two commits
$ git diff <branch-1>..<branch-2>   # diff off two branches