Git - 获取两个修订版本之间相同的文件列表 [英] Git - get a list of files that are identical between two revisions

查看:114
本文介绍了Git - 获取两个修订版本之间相同的文件列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

类似于的倒数

推荐答案

您可以通过查看 ls-tree diff 中的 - 仅限名称选项(在一行中完成,因此更容易从历史记录中进行搜索和使用):

You can do this by looking at unique values from ls-tree and diff with the --name-only options (done in one line so it's easier to search and use from history later):

cat <(git ls-tree --name-only -r HEAD) <(git diff --name-only HEAD^ HEAD) | sort | uniq -u

在这个例子中,2个修订版本是HEAD和HEAD ^。这不会产生副作用输出文件。

In the example, the 2 revisions are HEAD and HEAD^. This produces no side effect output files.

这篇关于Git - 获取两个修订版本之间相同的文件列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆