git stash

I’ve always wondered what the command is that lets you do stuff like change branches and checkout to older states without commiting, since git won’t let you do anything if you haven’t commited.

Well, I found the answer. It’s git stash. I think I will be using this a lot, considering how often my workflow gets interrupted. I wish I knew about it before I started working on this exponentiation mess (more on that later).

It is also nicer to test if my code breaks an old feature to stash instead of testing in sympy 0.6.4 installed on my system.

UPDATE: No wonder I didn’t find this earlier. stash isn’t listed in git --help.


2 Responses to git stash

  1. ulrik says:

    If you have big WIPs, another (common) git practice is to commit often, commit small commits. Then at merge time or more often, you use ‘rebase -i’ to reorder and squash together commits into commits/patches ready for submitting.

  2. Andy Terrel says:

    also check out stgit.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: