The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Practical Git: Save uncommitted changes with git stash

Practical Git: Save uncommitted changes with git stash

2:51
Sometimes when we are working we need a way to pause and switch gears to deal with something more critical; often when this happens we aren't ready to create a `git commit`; instead, we can use `git stash` to save our uncommitted changes locally, switch branches and fix the critical issue, switch back to our incomplete feature, and finally run `git stash apply` to get our unfinished changes back into our branch without affecting the rest of the codebase. In this lesson, we show a real world example of doing this with a critical bug.
Watch this lesson now
Avatar
egghead.io

Sometimes when we are working we need a way to pause and switch gears to deal with something more critical; often when this happens we aren't ready to create a git commit; instead, we can use git stash to save our uncommitted changes locally, switch branches and fix the critical issue, switch back to our incomplete feature, and finally run git stash apply to get our unfinished changes back into our branch without affecting the rest of the codebase. In this lesson, we show a real world example of doing this with a critical bug.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?