Skip to content

Commit c98730c

Browse files
authored
Merge pull request #141 from dmlemos/stash_additions
Stash additions
2 parents b748f5f + e849a6f commit c98730c

File tree

2 files changed

+50
-3
lines changed

2 files changed

+50
-3
lines changed

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
4949
* [Find out branches containing commit-hash](#find-out-branches-containing-commit-hash)
5050
* [Git Aliases](#git-aliases)
5151
* [Saving current state of tracked files without commiting](#saving-current-state-of-tracked-files-without-commiting)
52+
* [Saving current state of unstaged changes to tracked files](#saving-current-state-of-unstaged-changes-to-tracked-files)
5253
* [Saving current state including untracked files](#saving-current-state-including-untracked-files)
5354
* [Saving current state with message](#saving-current-state-with-message)
55+
* [Saving current state of all files (ignored, untracked, and tracked)](#saving-current-state-of-all-files-ignored-untracked-and-tracked)
5456
* [Show list of all saved stashes](#show-list-of-all-saved-stashes)
5557
* [Apply any stash without deleting from the stashed list](#apply-any-stash-without-deleting-from-the-stashed-list)
5658
* [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:__
406408
git stash save
407409
```
408410

411+
## Saving current state of unstaged changes to tracked files
412+
```sh
413+
git stash -k
414+
```
415+
416+
417+
__Alternatives:__
418+
```sh
419+
git stash --keep-index
420+
```
421+
422+
423+
```sh
424+
git stash save --keep-index
425+
```
426+
409427
## Saving current state including untracked files
410428
```sh
411-
git stash save -u
429+
git stash -u
412430
```
413431

414432

415433
__Alternatives:__
434+
```sh
435+
git stash save -u
436+
```
437+
438+
416439
```sh
417440
git stash save --include-untracked
418441
```
@@ -422,6 +445,22 @@ git stash save --include-untracked
422445
git stash save <message>
423446
```
424447

448+
## Saving current state of all files (ignored, untracked, and tracked)
449+
```sh
450+
git stash -a
451+
```
452+
453+
454+
__Alternatives:__
455+
```sh
456+
git stash --all
457+
```
458+
459+
460+
```sh
461+
git stash save --all
462+
```
463+
425464
## Show list of all saved stashes
426465
```sh
427466
git stash list

tips.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,21 @@
120120
"title": "Saving current state of tracked files without commiting",
121121
"tip": "git stash",
122122
"alternatives": ["git stash save"]
123+
}, {
124+
"title": "Saving current state of unstaged changes to tracked files",
125+
"tip": "git stash -k",
126+
"alternatives": ["git stash --keep-index", "git stash save --keep-index"]
123127
}, {
124128
"title": "Saving current state including untracked files",
125-
"tip": "git stash save -u",
126-
"alternatives": ["git stash save --include-untracked"]
129+
"tip": "git stash -u",
130+
"alternatives": ["git stash save -u", "git stash save --include-untracked"]
127131
}, {
128132
"title": "Saving current state with message",
129133
"tip": "git stash save <message>"
134+
}, {
135+
"title": "Saving current state of all files (ignored, untracked, and tracked)",
136+
"tip": "git stash -a",
137+
"alternatives": ["git stash --all", "git stash save --all"]
130138
}, {
131139
"title": "Show list of all saved stashes",
132140
"tip": "git stash list"

0 commit comments

Comments
 (0)