From c8abe4cc13d1ed340525d1dab18a65b29f0d343f Mon Sep 17 00:00:00 2001 From: Diogo Lemos Date: Fri, 24 Feb 2017 11:29:18 +0000 Subject: [PATCH 1/3] Add stash of unstaged changes to tracked files --- README.md | 17 +++++++++++++++++ tips.json | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/README.md b/README.md index 3afcc9f..b7e549b 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ 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) * [Show list of all saved stashes](#show-list-of-all-saved-stashes) @@ -406,6 +407,22 @@ __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 save -u diff --git a/tips.json b/tips.json index 0f7c9e4..ab99a12 100644 --- a/tips.json +++ b/tips.json @@ -120,6 +120,10 @@ "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", From 3fe8a233c09e7c2ed1878c00f9acd34bf636aecb Mon Sep 17 00:00:00 2001 From: Diogo Lemos Date: Fri, 24 Feb 2017 11:38:44 +0000 Subject: [PATCH 2/3] Add stash all --- README.md | 17 +++++++++++++++++ tips.json | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/README.md b/README.md index b7e549b..cad7841 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [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) @@ -439,6 +440,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 ab99a12..2693d2b 100644 --- a/tips.json +++ b/tips.json @@ -131,6 +131,10 @@ }, { "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" From e849a6f24a4ddaeeccc1595992fb87cddc99bc11 Mon Sep 17 00:00:00 2001 From: Diogo Lemos Date: Fri, 24 Feb 2017 11:44:13 +0000 Subject: [PATCH 3/3] No need for git stash save --- README.md | 7 ++++++- tips.json | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cad7841..f0bc850 100644 --- a/README.md +++ b/README.md @@ -426,11 +426,16 @@ git stash save --keep-index ## Saving current state including untracked files ```sh -git stash save -u +git stash -u ``` __Alternatives:__ +```sh +git stash save -u +``` + + ```sh git stash save --include-untracked ``` diff --git a/tips.json b/tips.json index 2693d2b..16b56eb 100644 --- a/tips.json +++ b/tips.json @@ -126,8 +126,8 @@ "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 "