Skip to content

Commit

Permalink
Update diff-index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelCurrin authored Aug 5, 2024
1 parent 4a8c6fe commit 45d7473
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions cheatsheets/version-control/git/commands/diff-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,36 +116,40 @@ $ git diff-index --cached HEAD
Jump to [Diff filter](#diff-filter) section.

Summary view, close to `git status -s`.
Summary view:

```sh
```console
$ git diff-index --name-status HEAD
M src/extension.ts
A src/workspace.ts
$ git diff-index --cached --name-status HEAD
A src/workspace.ts
```

That can be achieved with these:

```sh
$ git diff-index --name-status HEAD
M src/extension.ts
A src/workspace.ts
$ git status --short
$ git diff --name-status
```

### Stat

```sh
$ git diff-index --stat --cached HEAD
$ git diff-index --stat --cached HEAD
src/workspace.ts | 8 ++++++++
1 file changed, 8 insertions(+)
```

### Num stat

```sh
$ git diff-index --numstat --cached HEAD
$ git diff-index --numstat --cached HEAD
8 0 src/workspace.ts
```

```sh
$ git diff-index --numstat HEAD
$ git diff-index --numstat HEAD
82 55 src/extension.ts
8 0 src/workspace.ts
```
Expand Down

0 comments on commit 45d7473

Please sign in to comment.