markdown 如何列出提交中的所有文件?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 如何列出提交中的所有文件?相关的知识,希望对你有一定的参考价值。

## [How to list all the files in a commit?](https://stackoverflow.com/questions/424071/how-to-list-all-the-files-in-a-commit)

I am looking for a simple git command that provides a nicely formatted list of all files that were part of the commit given by a hash (SHA1), with no extraneous information.

------

**Preferred Way for Scripts** (because it's a plumbing command; meant to be programmatic):

```bash
$ git diff-tree --no-commit-id --name-only -r bd61ad98
index.html
javascript/application.js
javascript/ie6.js
```

**Another Way** (less preferred for scripts, because it's a porcelain command; meant to be user-facing)

```bash
$ git show --pretty="" --name-status bd61ad98    
index.html
javascript/application.js
javascript/ie6.js
```
The --no-commit-id suppresses the commit ID output.
The --pretty argument specifies an empty format string to avoid the cruft at the beginning.
The --name-only argument shows only the file names that were affected (Thanks Hank).
The --name-status argument is like name-only with a teeny bit of additional info
The -r argument is to recurse into sub-trees

以上是关于markdown 如何列出提交中的所有文件?的主要内容,如果未能解决你的问题,请参考以下文章

如何列出更改特定文件的所有提交?

如何列出存储库中的所有提交及其父信息以及使用命令行或 JGit 添加和删除的行?

如何列出用户定义的 docker 网络中的所有容器?

GIT-列出GIT中提交(或各种提交)的所有文件

如何找到提交给 git 分支的文件列表?

如何删除除 Markdown 之外的所有文件中的尾随空格?