Added git diff --staged to be synonym for git diff --cached

This commit is contained in:
Ranhiru Cooray 2016-06-12 19:53:00 +08:00
parent 1e2a0e10fb
commit c147aa64e2
2 changed files with 2 additions and 11 deletions

View File

@ -100,7 +100,6 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
* [View the GPG signatures in the commit log](#view-the-gpg-signatures-in-the-commit-log)
* [Remove entry in the global config.](#remove-entry-in-the-global-config)
* [Checkout a new branch without any history](#checkout-a-new-branch-without-any-history)
* [File diff between staging and the last file version.](#file-diff-between-staging-and-the-last-file-version)
* [Extract file from another branch.](#extract-file-from-another-branch)
* [List only the root and merge commits.](#list-only-the-root-and-merge-commits)
* [Merge previous two commits into one.](#merge-previous-two-commits-into-one)
@ -159,7 +158,7 @@ git diff
## Changes staged for commit
```sh
git diff --cached
git diff --cached or git diff --staged
```
## Show both staged and unstaged changes
@ -689,11 +688,6 @@ git config --global --unset <entry-name>
git checkout --orphan <branch_name>
```
## File diff between staging and the last file version.
```sh
git diff --staged
```
## Extract file from another branch.
```sh
git show <branch_name>:<file_name>

View File

@ -24,7 +24,7 @@
"tip": "git diff"
}, {
"title": "Changes staged for commit",
"tip": "git diff --cached"
"tip": "git diff --cached or git diff --staged"
}, {
"title": "Show both staged and unstaged changes",
"tip": "git diff HEAD"
@ -300,9 +300,6 @@
}, {
"title": "Checkout a new branch without any history",
"tip": "git checkout --orphan <branch_name>"
}, {
"title": "File diff between staging and the last file version.",
"tip": "git diff --staged"
}, {
"title": "Extract file from another branch.",
"tip": "git show <branch_name>:<file_name>"