28

I'm getting this error when running "git stash"

Cannot save the current status 

with no other information.

Why is that?

2
  • 1
    What does git status say? Commented Jul 9, 2019 at 19:09
  • "On branch master Your branch is up to date with 'origin/master'. nothing to commit, working tree clean Commented Jul 9, 2019 at 20:38

11 Answers 11

19

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

rm -f .git/refs/stash .git/refs/stash.lock 

That fixed it

Sign up to request clarification or add additional context in comments.

2 Comments

I had to delete .git/refs/stash.lock as well. After that git stash started to work well.
i got solution from your link, but the file your removed, not just that , my issue got resolve with this stackoverflow.com/a/19409320/4811421 answer from your link
17

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.

1 Comment

This was precisely my issue too. A precommit hook inside a docker container had changed the owner.
8

I solve this problem by git stash clear.

Comments

6

For me,

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

Worked

1 Comment

It is more safety: sudo chmod -R ug+w .
2

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.

1 Comment

"git merge --abort" gives me "fatal: There is no merge to abort (MERGE_HEAD missing).". If I reset to head, and change I single file to try to stash, I still get the same error
1

In my case, I had Visual Studio using git and was trying to stash using the command line. Closing Visual Studio solved the problem.

Comments

1

I solved it in Windows by right clicking on the shortcut to Git Bash and choosing "Run as administrator" before I run git stash.

I can verify that running Git Fork as administrator also solves this problem if using Git Fork to stash, so there is a good chance it will solve it in other git tools such as Git for Windows or Sourcetree.

Comments

0

This is an old question, but this may help Mac users.

If you are copying files from Time Machine manually, instead of restoring them through Time Machine, it'll add ACLs to everything, which can mess up your permissions.

For example, the section in this article that says "How to Fix Mac OS X File Permissions" shows that "everyone" has custom permissions, which messes it all up:

Bad permissions, from http://dreamlight.com/how-to-fix-mac-os-x-file-permissions

You need to remove the ACLs from those directories/files. This Super User answer goes into it, but here's the command:

sudo chmod -RN .

Then you can make sure your directories and files have the proper permissions. I use 750 for directories and 644 for files.

Comments

0

Run this

git reset --mixed 

and then

git stash 

before pull.

Comments

0

I had the same problem because some files changed their permissions (in ubuntu). I fixed it by running the command git stash with "sudo"

sudo git stash 

I hope you can fix the problem

Comments

0

I tried all the other solutions with no luck, but this worked for me:

rm -f .git/refs/stash.lock 

and then

git gc 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.