Skip to content

Instantly share code, notes, and snippets.

@Alexisvt
Forked from curtismckee/git-stash.md
Last active December 26, 2019 02:21
Show Gist options
  • Select an option

  • Save Alexisvt/73b71c0288feca47c35b148dc7cd5ead to your computer and use it in GitHub Desktop.

Select an option

Save Alexisvt/73b71c0288feca47c35b148dc7cd5ead to your computer and use it in GitHub Desktop.

Revisions

  1. Alexisvt revised this gist Dec 26, 2019. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion git-stash.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,9 @@
    `git stash list`
    - Lists all stashes on stack.
    - Lists all stashes on stack.

    `git stash push -m "message"`

    - Stash changes, where "message" is your note for that stash.

    `git stash apply stash@{0}`
    - Applies the changes from stash but does not delete from stack.
  2. Curtis Mckee revised this gist Feb 14, 2019. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion git-stash.md
    Original file line number Diff line number Diff line change
    @@ -15,4 +15,7 @@
    - Creates a branch with changes from stash.

    `git stash drop stash@{0}`
    - Deletes stash from stack.
    - Deletes stash from stack.

    `git stash clear`
    - Deletes all stashes from stack.
  3. Curtis Mckee created this gist Feb 14, 2019.
    18 changes: 18 additions & 0 deletions git-stash.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    `git stash list`
    - Lists all stashes on stack.

    `git stash apply stash@{0}`
    - Applies the changes from stash but does not delete from stack.

    `git stash pop stash@{3}`
    - Applies the changes from stash and deletes from the stack.

    `git stash show stash@{2}`
    - Shows the diff of the stash.
    - Use the `-p` flag to show full diff.

    `git stash branch <name> stash@{1}`
    - Creates a branch with changes from stash.

    `git stash drop stash@{0}`
    - Deletes stash from stack.