🔀Git Stash
Also known as Stash
Put your changes to one side for now. Then bring them back when you are ready.
Think of it like
Think of it like toys in a drawer while you eat. After dinner, you take them out again.
Example
Jack is halfway through a change when a bug report comes in. He stashes his work, fixes the bug on main, then pops the stash.
Why it matters
Definition
Example code
console
$ git stash
Saved working directory and index state WIP on main: 26b91bd Blue greeting
$ git stash list
stash@{0}: WIP on main: 26b91bd Blue greetingCommon mistake
Key takeaways
- 1Set work aside. Changes leave your files for now.
- 2Pop to get back. git stash pop restores them.
- 3Local only. A stash is never pushed.