Git stash error "Cannot save the current status"

You get this error sometime when you are in mid of a conflict. You will get more information if you check git status and see if you are in mid of a merge conflict resolution.

You can either abort the merge: If you don't want to consider your previous merge (you are sure and you would lose the history information associated with the merge), you can abort then using

git merge --abort

Or reset your git state to original HEAD:

git reset ORIG_HEAD

I hope it helps.


For me,

cd .git/
sudo chmod -R 777 *
sudo chown -R owner:owner *
git add . && git stash

Worked


In my case, .git/refs/stash was owned by root.

Simply running chown -R <user>:<group> .git (Linux) fixed it.

Note that you might only need to chown -R <user>:<group> .git/refs/stash, though.

Replace <user> and <group> with your user name and main group.


Found the solution here: Git stash fails 'error: unable to resolve reference refs/stash: No such file or directory'

rm -f .git/refs/stash

That fixed it

Tags:

Git