创建更改的文件/目录/等的列表。在两个标签之间使用 git
我需要在使用 git 控制的项目中的两个标签之间生成某种变更日志,特别是 android 源代码。该列表应包括已编辑、移动、重命名、删除、创建的任何文件/目录/等。
任何帮助都会很棒。如果你有办法一次性在整个 Android 源代码上执行此操作......那就更好了。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果需要查找哪些文件不同:
如果需要查找所有更改的文件:
--pretty=format:
是禁止打印有关提交的信息,并仅打印差异部分。请注意,在 git log 的情况下,
和
的顺序很重要。If you need to find which files differ:
If you need to find all changed files:
The
--pretty=format:
is to supress printing information about commits, and print only the diff part. Note that in the case of git log the order of<tag1>
and<tag2>
matters.正如我在评论中提到的,“我如何找到公共文件在 git 分支之间发生了变化?” 是这里的主要解决方案:
或者
(也在 Gitology 食谱)
但是:如“如何获取我的 git 存储库中删除的目录列表?”,Git 只跟踪文件内容,而不跟踪目录本身。
要包含有关目录的信息,您需要开始使用
git diff-tree
。类似的东西(根据 Charles Bailey):
As I mention in the comments, "How do I find common files changed between git branches?" is the main solution here:
or
(Also mentioned in Gitology recipe)
BUT: as mentioned in "How to get a list of directories deleted in my git repository?", Git only tracks content of files, not directories themselves.
To include informations about directories, you need to start playing with
git diff-tree
.Something like (according to Charles Bailey):