Merge pull request #81 from Ranhiru/add-staged-as-a-synonym-for-cached

Added git diff --staged to be synonym for git diff --cached
This commit is contained in:
hemanth.hm 2016-06-13 21:48:37 +05:30 committed by GitHub
commit 1c07f20d21
2 changed files with 8 additions and 10 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) * [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) * [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) * [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) * [Extract file from another branch.](#extract-file-from-another-branch)
* [List only the root and merge commits.](#list-only-the-root-and-merge-commits) * [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) * [Merge previous two commits into one.](#merge-previous-two-commits-into-one)
@ -163,6 +162,12 @@ git diff
git diff --cached git diff --cached
``` ```
__Alternatives:__
```sh
git diff --staged
```
## Show both staged and unstaged changes ## Show both staged and unstaged changes
```sh ```sh
git diff HEAD git diff HEAD
@ -690,11 +695,6 @@ git config --global --unset <entry-name>
git checkout --orphan <branch_name> git checkout --orphan <branch_name>
``` ```
## File diff between staging and the last file version.
```sh
git diff --staged
```
## Extract file from another branch. ## Extract file from another branch.
```sh ```sh
git show <branch_name>:<file_name> git show <branch_name>:<file_name>

View File

@ -24,7 +24,8 @@
"tip": "git diff" "tip": "git diff"
}, { }, {
"title": "Changes staged for commit", "title": "Changes staged for commit",
"tip": "git diff --cached" "tip": "git diff --cached",
"alternatives": ["git diff --staged"]
}, { }, {
"title": "Show both staged and unstaged changes", "title": "Show both staged and unstaged changes",
"tip": "git diff HEAD" "tip": "git diff HEAD"
@ -300,9 +301,6 @@
}, { }, {
"title": "Checkout a new branch without any history", "title": "Checkout a new branch without any history",
"tip": "git checkout --orphan <branch_name>" "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.", "title": "Extract file from another branch.",
"tip": "git show <branch_name>:<file_name>" "tip": "git show <branch_name>:<file_name>"