git对比任意两次commit提交的差异文件

git 文件 编程技术
发布日期 2023-02-03 更新日期 2023-02-03 阅读次数 229 文章字数 602

git diff commitID1 commitID2 对比文件差异

--name-only仅列出文件名

此外,可以事业 --diff-filter 过滤。

git diff --diff-filter 可以过滤几种不同的变化:

--diff-filter=[(A|C|D|M|R|T|U|X|B)…[*]]

Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R), have their type (i.e. regular file, symlink, submodule, …) changed (T), are Unmerged (U), are Unknown (X), or have had their pairing Broken (B).

只选择那些添加 (A), 赋值 (C), 删除 (D), 修改 (M), 重命名 (R)的文件, 它们的类型(如 普通文件, 符号链接, 子模块, …) 是否改变 (T), 是否未合并 (U), 是未知 (X), 或它们的对崩溃(B). 任何过滤字符的组合(包括none)均可使用。当组合中包括All或none,如果任一文件匹配了其他选项,就选择了所有路径。如果没有文件匹配其他选项,什么都不做。

Diff现在支持接受小写字母参数,含义为展示所有非指定类型的变化。

实例,获取新增、修改的文件列表:

git diff --name-only --diff-filter=d 081fa89ee e44ca99e6

增量打包:

git diff --name-only --diff-filter=d 081fa89ee e44ca99e6 | xargs zip update.zip


文章作者: 朱丰华

文章链接: https://smart.52dixiaowo.com/blog/post-344.html

版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。

git 文件

发表评论

相关推荐
朱丰华   |   1个月前   |   启动 · php

debian12开机启动sh

82    评论    点赞
朱丰华   |   10个月前   |   git

git从缓存中移除数据git rm --cached

465    评论    点赞
朱丰华   |   1年前   |   linux · upx

Linux下安装UPX

521    评论    点赞
朱丰华   |   1年前   |   git

git push -u参数是什么意思?--set-upstream

318    评论    点赞
朱丰华   |   1年前   |   git · hub · 仓库

go克隆并引用github仓库

177    评论    点赞
朱丰华   |   1年前   |   请求 · 一个

ab测压命令,apache测压工具

219    评论    点赞
朱丰华   |   1年前   |   php · 缓存 · opcache

php 加速、提高并发opcache

254    评论    点赞
朱丰华   |   1年前   |   go · gopath

Go自定义包并安装(GOPATH)

147    评论    点赞
朱丰华   |   1年前   |   变量 · mysql · sql · 用户

MySQL用户自定义变量

125    评论    点赞
朱丰华   |   1年前   |   sql · php

PHP如何使用PDO批量执行SQL?

153    评论    点赞
朱丰华   |   1年前   |   sed · 文件

Shell 指定行处理head、tail、sed

181    评论    点赞
朱丰华   |   1年前   |   linux · 内容

linux环境下,对于一个大文件,如何查看其中某行的内容

93    评论    点赞
朱丰华   |   1年前   |   linux · 文件 · 行数

linux 取得文件行数

75    评论    点赞
朱丰华   |   1年前   |   下载 · 请求

idm、浏览器下载发送两次下载请求

203    评论    点赞
朱丰华   |   1年前   |   文件 · linux · 修改

linux文件的三个时间atime,mtime,ctime分别表示什么?

329    评论    点赞
朱丰华   |   1年前   |   linux · 文件 · 统计

linux递归统计文件夹下的文件数量

228    评论    点赞
朱丰华   |   1年前   |   linux · 文件

linux递归统计文件夹大小、du命令_Linux du命令:查看文件夹和文件的磁盘占用情况

239    评论    点赞
朱丰华   |   1年前   |   git · add · 文件

git add -A 和 git add . 的区别

135    评论    点赞
朱丰华   |   1年前   |   php

windows下编写、编译php扩展

201    评论    点赞
朱丰华   |   1年前   |   linux · php

linux下编写、编译php扩展

177    评论    点赞
{{item.author_name}}   |   {{new Date(item.date*1000).log()}}   |   {{it}} ·

{{item.title}}

{{item.uv}}    评论    点赞