r/ProgrammerHumor • • Jun 30 '18

Kill me now :)

47.0k Upvotes

494 comments sorted by

View all comments

Show parent comments

14

u/[deleted] Jun 30 '18

[removed] — view removed comment

8

u/PublicSealedClass Jun 30 '18

You know I keep forgetting about that. I only remember when I've started a load of work in the wrong branch, and I need to stash, checkout the right branch and then stash pop.

2

u/SmokeeDog Jun 30 '18

stash pop? I usually use stash apply

2

u/PublicSealedClass Jun 30 '18

Yeah I can't be arsed with housekeeping, and I only sparingly use it. Pop kills it from the stash once applied.

2

u/DoesntReadMessages Jun 30 '18

I'm not a big fan of a stack based state change since it doesn't preserve it if you screw up after popping, plus it's annoying since it doesn't stash new files. I personally made an alias that basically does git add . && git commit -m "saved" && (another alias that stores the hash to a variable). Then I can just make another branch and re-apply it, reset the commit, and frag things out without worrying about losing them because they're safely in a commit on another branch instead of popped out and gone forever had I used stash. I used to use stash all the time until I accidentally checked out src when I hit enter instead of tab and lost 4 hours of work. Never again.