News for hackers. Stuff that matters.
Re:Lesser known Git commands by ashark on Friday September 30, 2016 @11:48AM (#12613167)
My #1 use of stash is as the quickest way to express "get rid of all this crap". I rarely intend to ever retrieve it.
Re:Lesser known Git commands by dahart on Friday September 30, 2016 @12:07PM (#12613294)
Now here's one I actually like. As an alternative to git reset, a git stash is safer, and gives you an easier way than reflog to recover if you dropped a commit you want back.
Re:Lesser known Git commands by spike021 on Friday September 30, 2016 @12:47PM (#12613592)
For one of my projects, the 'build process' requires that I use the git archive command (basically archive to .tar.gz without any git-related files/directories). git archive on its own is fine for final builds because it's based off of HEAD for the current branch, but if I want to test a build with working changes, I would either need to commit all the changes _or_ use git stash and then archive based on the state I just stashed.

So in this case git stash works a lot better for a 'temporary' commit, kind of deal.

It might not be optimal but I've found the process to work pretty well for this particular project's situation.

Re:Lesser known Git commands by ianleeclark on Friday September 30, 2016 @11:56AM (#12613227)
git checkout -- .

Also works well for this use case

Re:Lesser known Git commands by loeg on Friday September 30, 2016 @11:59AM (#12613248)
'git reset'.
Re:Lesser known Git commands by ashark on Friday September 30, 2016 @12:02PM (#12613265)
Doesn't do the same thing, without some more options. Stash is shorter.