Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Not using <a href="http://git-scm.com/docs/git-stash" rel="noreferrer"><code>git stash</code></a></p> <p>Scenario: You're working on feature A. It's taken you about 2 days, and you're about a day from completing it. You've gotten good code written, but there's more to do. Your boss shows up and says "Hey I need Feature B right now. Should take 10 seconds."</p> <p>Sure - 10 seconds to write it, 2 days of work lost. Or 2 hours trying to comment out and hack all the code you wrote for the past 2 days to get everything back to a working state.</p> <p><code>git stash</code> is here to save the day. Just type <code>git stash</code> at the command line, at the root of your project, and all your recent changes go in the "stash," which is a stack of changes. Now you're back to where you were 2 days ago, but your work isn't lost. You make the 10 second change, check it in, then type <code>git stash pop</code> to get your changes back (and remove them from the stack).</p> <p>As may be evident, if you're having a TERRIBLE day you can stash multiple times, although obviously the more you do so, the less fun merging may be when you finally git stash pop them all. If you manage to accumulate a lot of stash over months of work you have <code>git stash list</code> to look them over, <code>git stash pop</code> and <code>git stash drop</code> to pick and choose which ones are worth bringing back and which are best to just toss, and <code>git stash clear</code> if you only stash awful ideas.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload