News for hackers. Stuff that matters.
Re:Git tips to stop you getting fired by yxhuvud on Monday April 08, 2013 @11:28AM (#5512278)
Snapshot stack? Huh.

git checkout -b

seems a lot simpler.

Re:Git tips to stop you getting fired by bumeye on Monday April 08, 2013 @03:21PM (#5513870)
Simpler indeed. That's actually what stash does internally.

I usually don't make a separate branch, but just commit it in the current branch. Then you can rebase or amend later. You never need 'snapshot' if you know rebase -i.

Re:Git tips to stop you getting fired by just2n on Monday April 08, 2013 @06:10PM (#5514995)
You can also just `git reset HEAD~1` if you want to have your index reflect the changes rather than just working on top of an empty index in a new commit. My workflow is a --no-verify commit on the branch, then when I come back, just reset to the previous commit and continue.

This is pretty much identical to stashing, though I prefer it since it means the part of git I use is smaller.

Re:Git tips to stop you getting fired by Cyranix on Monday April 08, 2013 @01:07PM (#5512963)
I use this pattern from time to time (and should probably alias it). While checkout -b (or reset --hard <hash>) is good for most cases, I like making a stash entry if I'm in the middle of a logical unit of work and don't want to commit before I do something experimental.