0

Example (bash):

> cd ~/repo1
> git stash create

Clearly something is wrong, maybe there is already something stashed?

> git stash drop
No stash entries found

Maybe there is something wrong with git, pick a random other repository and rerun:

> cd ~/repo2
> git stash create
f6fed634ce4de28d8696de39f6a338df8edef59c

What's going on here?

SwissCodeMen
  • 2,397
  • 3
  • 12
  • 21
mkk
  • 340
  • 3
  • 13
  • That's not really a MWE cause `~/repo1` doesn't exist on my system. What did you do leading up to this? Maybe you added an alias to `stash` in the repo's gitconfig? Try `git help stash`. BTW what shell are you using? – wjandrea Jul 17 '20 at 23:39
  • quite right, @wjandrea, OP is corrected – mkk Jul 18 '20 at 01:28
  • Is that Bash? `cd(...)` is invalid syntax. Maybe you're using a different version or have some feature turned on? – wjandrea Jul 18 '20 at 01:45
  • 1
    Thanks, that's a typo, had been writing some Julia right before I updated the post to add cd's, to make the example more cohesive. – mkk Jul 18 '20 at 15:40

1 Answers1

2

If there's nothing to stash, there's no unstaged or staged changes, it won't make a commit object.

$ git status
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   this
$ git stash create
a42c068d4b8139a6d572ad04e77f1bd0057b3408

$ git restore this
$ git status
On branch master
nothing to commit, working tree clean
$ git stash create
$
Schwern
  • 127,817
  • 21
  • 150
  • 290