diff --git a/README.md b/README.md index 3afcc9f..f0bc850 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,10 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Find out branches containing commit-hash](#find-out-branches-containing-commit-hash) * [Git Aliases](#git-aliases) * [Saving current state of tracked files without commiting](#saving-current-state-of-tracked-files-without-commiting) +* [Saving current state of unstaged changes to tracked files](#saving-current-state-of-unstaged-changes-to-tracked-files) * [Saving current state including untracked files](#saving-current-state-including-untracked-files) * [Saving current state with message](#saving-current-state-with-message) +* [Saving current state of all files (ignored, untracked, and tracked)](#saving-current-state-of-all-files-ignored-untracked-and-tracked) * [Show list of all saved stashes](#show-list-of-all-saved-stashes) * [Apply any stash without deleting from the stashed list](#apply-any-stash-without-deleting-from-the-stashed-list) * [Apply last stashed state and delete it from stashed list](#apply-last-stashed-state-and-delete-it-from-stashed-list) @@ -406,13 +408,34 @@ __Alternatives:__ git stash save ``` +## Saving current state of unstaged changes to tracked files +```sh +git stash -k +``` + + +__Alternatives:__ +```sh +git stash --keep-index +``` + + +```sh +git stash save --keep-index +``` + ## Saving current state including untracked files ```sh +git stash -u +``` + + +__Alternatives:__ +```sh git stash save -u ``` -__Alternatives:__ ```sh git stash save --include-untracked ``` @@ -422,6 +445,22 @@ git stash save --include-untracked git stash save ``` +## Saving current state of all files (ignored, untracked, and tracked) +```sh +git stash -a +``` + + +__Alternatives:__ +```sh +git stash --all +``` + + +```sh +git stash save --all +``` + ## Show list of all saved stashes ```sh git stash list diff --git a/tips.json b/tips.json index 0f7c9e4..16b56eb 100644 --- a/tips.json +++ b/tips.json @@ -120,13 +120,21 @@ "title": "Saving current state of tracked files without commiting", "tip": "git stash", "alternatives": ["git stash save"] +}, { + "title": "Saving current state of unstaged changes to tracked files", + "tip": "git stash -k", + "alternatives": ["git stash --keep-index", "git stash save --keep-index"] }, { "title": "Saving current state including untracked files", - "tip": "git stash save -u", - "alternatives": ["git stash save --include-untracked"] + "tip": "git stash -u", + "alternatives": ["git stash save -u", "git stash save --include-untracked"] }, { "title": "Saving current state with message", "tip": "git stash save " +}, { + "title": "Saving current state of all files (ignored, untracked, and tracked)", + "tip": "git stash -a", + "alternatives": ["git stash --all", "git stash save --all"] }, { "title": "Show list of all saved stashes", "tip": "git stash list"