Skip to content

Commit 7810dda

Browse files
committed
Clarification of git diff-tree and ls-tree
1 parent 964216b commit 7810dda

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<!-- @doxie.inject start toc -->
55
<!-- Don’t remove or change the comment above – that can break automatic updates. -->
66
* [Overwrite pull](https://github.com/git-tips/tips#overwrite-pull)
7-
* [List of all the files changed in a commit](https://github.com/git-tips/tips#list-of-all-the-files-changed-in-a-commit)
7+
* [List of all files changed in a commit](https://github.com/git-tips/tips#list-of-all-files-changed-in-a-commit)
8+
* [List of all files till a commit](https://github.com/git-tips/tips#list-of-all-files-till-a-commit)
89
* [Git reset first commit](https://github.com/git-tips/tips#git-reset-first-commit)
910
* [List all the conflicted files](https://github.com/git-tips/tips#list-all-the-conflicted-files)
1011
* [List all branches that are already merged into master](https://github.com/git-tips/tips#list-all-branches-that-are-already-merged-into-master)
@@ -35,7 +36,12 @@
3536
git fetch --all && git reset --hard origin/master
3637
```
3738

38-
## List of all the files changed in a commit
39+
## List of all files changed in a commit
40+
```sh
41+
git diff-tree --no-commit-id --name-only -r <commit-ish>
42+
```
43+
44+
## List of all files till a commit
3945
```sh
4046
git ls-tree --name-only -r <commit-ish>
4147
```

tips.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
"tip": "git fetch --all && git reset --hard origin/master"
55
},
66
{
7-
"title": "List of all the files changed in a commit",
7+
"title": "List of all files changed in a commit",
8+
"tip": "git diff-tree --no-commit-id --name-only -r <commit-ish>"
9+
},
10+
{
11+
"title": "List of all files till a commit",
812
"tip": "git ls-tree --name-only -r <commit-ish>"
913
},
1014
{

0 commit comments

Comments
 (0)