【Git】查看改动文件清单

源站: 老姜博客 Git之改动文件清单

方法一

格式: git diff --name-only [SHA1 [SHA2]]

示例:

$ git diff --name-only HEAD~5 HEAD
docs/.vuepress/config.js
docs/README.md
docs/css/23-transform.md
docs/css/24-box-sizing.md
docs/frontend/css.md
docs/frontend/vue.md

方法二

格式: git log --name-status --oneline [SHA1..SHA2]

该命令比上面的命令拆分的细一些,基于commit进行分组,同时对于每个文件的改动类型进行说明

示例:

$ git log --name-status --oneline HEAD~5 HEAD
d932af8 (HEAD -> master, origin/master) fix
M       docs/css/23-transform.md
M       docs/css/24-box-sizing.md
M       docs/frontend/vue.md
30751f4  disqus
M       docs/css/24-box-sizing.md
2fd83d9 css box-sizing
M       docs/.vuepress/config.js
M       docs/README.md
A       docs/css/24-box-sizing.md
M       docs/frontend/css.md
5ccbaa2 fix
M       docs/css/23-transform.md
34f5d25 补充示例
M       docs/css/23-transform.md
57def33 新增css transform
M       docs/.vuepress/config.js
M       docs/README.md
A       docs/css/23-transform.md
M       docs/frontend/css.md

改动清单前缀符解释如下:

  • M modified - File has been modified
  • C copy-edit - File has been copied and modified
  • R rename-edit - File has been renamed and modified
  • A added - File has been added
  • D deleted - File has been deleted
  • U unmerged - File has conflicts after a merge

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值