Manuals / Git & GitHub / Chapter 7

B · Collaborate · intermediate · Day 5 · Chapter 7 of 12

Stash & conflict resolution

git stash saves WIP without committing. Conflicts: read markers, choose wisely, test after resolve.

Path progress
53%

Step 1 of 3

Stash WIP

git stash push -m "wip login". Switch branches. git stash pop to restore.

Stash WIPDrag stickies · tap for tips
Study mapDrag stickies · tap for tipsKeep it shortdrag · tap →Name the waitdrag · tap →Scope locatorsdrag · tap →Trace when stuckdrag · tap →One browser firstdrag · tap →Isolate statedrag · tap →Assert the UIdrag · tap →Retry wiselydrag · tap →Seed datadrag · tap →Close the loopdrag · tap →Keep it shortdrag · tap →Name the waitdrag · tap →Scope locatorsdrag · tap →Trace when stuckdrag · tap →One browser firstdrag · tap →Isolate statedrag · tap →Pathwise hackdrag · tap →Stash WIPdrag · tap →Try thisdrag · tap →Follow the dashed drag · tap →

Example

git stash push -m "wip"
git switch main
# do other work
git switch feature
git stash pop

Do this now

Start edit, stash, switch branch, return, pop.

Was this step clear?
Chapter learning outcomes
  • git stash / pop
  • Conflict markers
  • Merge tool basics
  • Post-resolve verification

Clear these before you leave

Side quest

Stash list

Create 2 stashes. git stash list. Apply selectively.