Skip to content

Commit c8abe4c

Browse files
author
Diogo Lemos
committed
Add stash of unstaged changes to tracked files
1 parent b748f5f commit c8abe4c

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ 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)
5455
* [Show list of all saved stashes](#show-list-of-all-saved-stashes)
@@ -406,6 +407,22 @@ __Alternatives:__
406407
git stash save
407408
```
408409

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

tips.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@
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",
125129
"tip": "git stash save -u",

0 commit comments

Comments
 (0)