如何获得在两个Git提交之间更改的所有文件的列表? [英] How to get a list of all files that changed between two Git commits?

查看:88
本文介绍了如何获得在两个Git提交之间更改的所有文件的列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



由于官僚作风,我需要获取存储库中所有已更改文件的列表以获取报告(我现在的源代码已开始)。运行以获取此列表?

解决方案

对于在给定的SHA和您当前的提交之间更改的文件:

  git diff --name-only<开始SHA> HEAD 

或者您想包含已更改但尚未提交的文件:

  git diff --name-only<开始SHA> 

更一般地说,下面的语法总是告诉你哪些文件在两次提交之间发生了变化或其他名称):

  git diff --name-only< commit1> < commit2> 


Due to bureaucracy, I need to get a list of all changed files in my repository for a report (I started with existing source code).

What should I run to get this list?

解决方案

For files changed between a given SHA and your current commit:

git diff --name-only <starting SHA> HEAD

or if you want to include changed-but-not-yet-committed files:

git diff --name-only <starting SHA>

More generally, the following syntax will always tell you which files changed between two commits (specified by their SHAs or other names):

git diff --name-only <commit1> <commit2>

这篇关于如何获得在两个Git提交之间更改的所有文件的列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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