Stashing
suggest changeSyntax
git stash list [<options>]git stash show [<stash>]git stash drop [-q|--quiet] [<stash>]git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]git stash branch <branchname> [<stash>]git stash [save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet] [-u|--include-untracked] [-a|--all] [<message>]]git stash cleargit stash create [<message>]git stash store [-m|--message <message>] [-q|--quiet] <commit>
Parameters
| Parameter | Details |
|---|---|
| show | Show the stash as a diff against its original parent. With no stash named, shows the latest one. |
| list | List current stashes. stash@{0} is the latest. Each line includes the branch that was current and a short description of the commit the stash was based on. |
| pop | Remove one stash from the list and apply it to the working tree. |
| apply | Like pop, but leave the stash in the list. |
| clear | Remove every stash. Those commits can then be pruned and may be impossible to recover. |
| drop | Remove one stash from the list. With no argument, removes stash@{0}. |
| create | Create a stash commit and print its object name, without storing it in the ref namespace. Meant for scripts. Prefer save or push. |
| store | Store a commit created by git stash create in the stash ref. Meant for scripts. |
Remarks
Stashing allows us to have a clean working directory without losing any information. Then, it’s possible to start working on something different and/or to switch branches.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents