Live data from Hacker News

Git: how to use stash

softwarecave.org

1–10 of 43 posts

Re: Git: how to use stash

#3
I sometimes prefer using the git-wip commands.

https://github.com/tjmehta/git-wip

Let's me organize my "stashes" based on work-in-progress local branch commits. Also easier to rebase onto if it's a local branch that hasn't been pushed yet etc.

  git wip 
    - alias for git add .; git commit -m __wip;

  git unwip 
    - checks if last commit is a __wip and git reset HEAD^

Re: Git: how to use stash

#7
I hardly use stash any more. If I need to "stash" something, I just commit it. The reason this is okay is because we work on very small branches, with the aim of squashing everything into a single commit before merging it with master. So it doesn't matter if I commit half-baked code to my branch, since it's going to be squashed anyway.

Re: Git: how to use stash

#9

Curious.... why not use feature branches for absolutely everything and follow the git flow and treat hot fixes as prescribed?

Depends on what you're working on, really. I find myself using stash when I quickly want to undo a change to check something, but preserve it for future use.

Re: Git: how to use stash

#10

Does anyone know why stash names are so ugly? I've always found typing "git stash apply stash@{3}" to be pretty painful (not to mention redundant).

Making an alias to use something like `stash apply #3` shouldn't be too complicated
Post reply on HN