-
-
Save Dunstonhary/d5e573761e2f1326edf599898eb6349a to your computer and use it in GitHub Desktop.
Revisions
-
joseluisq revised this gist
Nov 30, 2020 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,14 +20,14 @@ _**Note:** The commit message will only be in this form (starting with "WIP on") __Source:__ View the complete answer at https://stackoverflow.com/a/91795/2510591 ## 3. If your stash commit is not listed or you don't find it (optional) If your stash was already applied but you don't see it, for example after resolving a conflict or reset. Follow these steps: - Run `git fsck --no-reflog | awk '/dangling commit/ {print $3}'` - Pick a stash commit hash and use `git show COMMIT_HASH` in order to examine the stash commit diff of your changes. - After found your changes just use the corresponding commit of your stash changes and then just apply it using `git stash apply COMMIT_HASH`. ## Bonus -
joseluisq revised this gist
Oct 21, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,7 +20,7 @@ _**Note:** The commit message will only be in this form (starting with "WIP on") __Source:__ View the complete answer at https://stackoverflow.com/a/91795/2510591 ## 3. If you stash commit is not listed or you don't find it (optional) If you stash was already applied but you don't see it, for example after resolving a conflict or reset. Follow these steps: -
joseluisq revised this gist
Oct 21, 2020 . 1 changed file with 9 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,6 +20,15 @@ _**Note:** The commit message will only be in this form (starting with "WIP on") __Source:__ View the complete answer at https://stackoverflow.com/a/91795/2510591 ## 3. If you stash commit gets not listed or you don't find it (optional) If you stash was already applied but you don't see it, for example after resolving a conflict or reset. Follow these steps: - Run `git fsck --no-reflog | awk '/dangling commit/ {print $3}'` - Pick a stash commit hash and use `git show COMMIT_HASH` in order to explore the stash commit diff of your changes. - Identify the commit of your stash changes and just apply it using `git stash apply COMMIT_HASH` ## Bonus If you are [Fish shell](https://fishshell.com/) user, you can take a look at [GitNow](https://github.com/joseluisq/gitnow) which is a tool to perform faster Git operations and that can also stash your changes for you. -
joseluisq revised this gist
Jul 22, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,4 +22,4 @@ __Source:__ View the complete answer at https://stackoverflow.com/a/91795/251059 ## Bonus If you are [Fish shell](https://fishshell.com/) user, you can take a look at [GitNow](https://github.com/joseluisq/gitnow) which is a tool to perform faster Git operations and that can also stash your changes for you. -
joseluisq revised this gist
Jul 22, 2020 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,14 +8,18 @@ git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling com _This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph._ __bash/sh shell users:__ Version above is for [Fish shell](https://fishshell.com/), so if you are Bash/SH user just add a `$` sign before to the left parenthesis. ## 2. Once you know the hash of the commit you want, you can apply it as a stash ```sh git stash apply YOUR_WIP_COMMIT_HASH_HERE ``` _**Note:** The commit message will only be in this form (starting with "WIP on") if you did not supply a message when you did git stash._ __Source:__ View the complete answer at https://stackoverflow.com/a/91795/2510591 ## Bonus If you are [Fish shell](https://fishshell.com/) user, you can take a look [GitNow](https://github.com/joseluisq/gitnow) which is a tool to perform faster Git operations and that can also stash your changes for you. -
joseluisq revised this gist
Oct 11, 2019 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,16 @@ # How to recover a dropped stash in Git? ## 1. Find the stash commits ```sh git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' ) ``` _This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph._ __bash/sh shell users:__ Version above is for Fish shell, so if you are bash/sh user just add a `$` sign before to the left parenthesis. ## 2. Once you know the hash of the commit you want, you can apply it as a stash ```sh git stash apply YOUR_WIP_COMMIT_HASH -
joseluisq revised this gist
Feb 2, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,14 @@ # How to recover a dropped stash in Git? __1. Find the stash commits:__ ```sh git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' ) ``` _This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph._ __2. Once you know the hash of the commit you want, you can apply it as a stash:__ ```sh git stash apply YOUR_WIP_COMMIT_HASH -
joseluisq created this gist
Feb 2, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ # How to recover a dropped stash in Git? 1. Find the stash commits: ```sh git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' ) ``` _This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph._ 2. Once you know the hash of the commit you want, you can apply it as a stash: ```sh git stash apply YOUR_WIP_COMMIT_HASH ``` _Note: The commit message will only be in this form (starting with "WIP on") if you did not supply a message when you did git stash._ __Source:__ View the complete answer at https://stackoverflow.com/a/91795/2510591