Git: how to use stash
softwarecave.org
Git: how to use stash
1–10 of 43 posts
Re: Git: how to use stash
#2Does 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).
Re: Git: how to use stash
#3I 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
#4Curious.... why not use feature branches for absolutely everything and follow the git flow and treat hot fixes as prescribed?
Re: Git: how to use stash
#5Missing my favorite flag for stash: --include-untracked.
This will also stash any files that are not currently being tracked by git.
Re: Git: how to use stash
#6My favorite stash option is -p which let you select which lines you want to stash.
Re: Git: how to use stash
#7I 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
#8My favorite stash option is -p which let you select which lines you want to stash.
Yes, -p is great, also on `git add`.
Re: Git: how to use stash
#9Curious.... 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
#10Does 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