Git Cheatsheet - Quick Git Command Reference

Quick reference for common Git commands. Search, copy, and use Git commands instantly.

Share
Back to Git Cheatsheet

git stash

Temporarily save working directory changes

Syntax

git stash [push] [options]

Common Options

OptionDescription
pushStash current changes
push -m <msg>Stash with description message
push -uStash including untracked files
push -aStash all files including ignored
listList all stashes
showShow latest stash changes
popApply and drop latest stash
apply [stash]Apply stash without dropping
drop [stash]Drop specific stash
clearClear all stashes
branch <name>Create new branch from stash

Examples

git stash

Stash working directory changes

git stash push -m "WIP: login feature"

Stash with message

git stash pop

Apply latest stash and remove

git stash list

List all stashes

git stash apply stash@{1}

Apply specific stash without dropping

Related Tools

More Code & Dev Tools