1

Is it possible to hide a stash in git?

Basically, there's a stash that I'm 95% sure I won't need. I'd like to be able to not show it when I do a normal git stash list, but if I decide I do need it after all, I'd like to be able to pass some sort of --show-everything option to git stash list and find it.

Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
  • I don't think there's a way to hide it. However you could move the stash to a new branch. – Nayuki Nov 17 '15 at 00:25
  • 1
    maybe like http://stackoverflow.com/a/25173231 or turn it into a .patch file stored somewhere else and then drop the stash – zapl Nov 17 '15 at 00:26
  • @NayukiMinase Is it possible to only show stashes for a given branch? – Andrew Grimm Nov 17 '15 at 00:26
  • http://stackoverflow.com/questions/20526355/is-git-stash-branch-specific-or-for-the-whole-repository Look here, yes it is possible – m.aibin Nov 17 '15 at 00:31
  • 1
    @m.aibin which post on that page answers my question? – Andrew Grimm Nov 17 '15 at 00:39
  • 1
    If you want the behavior to be per-branch, you can just make a commit (or multiple commits) on the branch. You can always "unmake" the commit(s) later (e.g., with git reset, either --soft or --mixed; see the git reset documentation; or with git rebase -i to keep only the eventual "real" commit(s) while discarding the temporaries). – m.aibin Nov 17 '15 at 00:42
  • 2
    This is a perfect use case for creating a branch, and not at all what stash is designed for. – Chris Martin Nov 17 '15 at 00:44

0 Answers0