fatal: Unable to read current working directory: No such file or directory

I got this message when trying to execute git commands in Crosh on a Chromebook.

fatal: Unable to read current working directory: No such file or directory

The local files were on a removable drive (an SDXC card in this case). I fixed it by changing directory up and back into the repo's main directory:

$ cd ..
$ cd (my repo's directory)

And presto, git was working again. I've used this set up a lot, I have no idea what happened, other than maybe Chrome OS got confused and didn't know what was going on. But

$ pwd

worked fine before I fixed the issue, while the error was happening.


Your current directory doesn't exist on the master branch. It was deleted when you checked it out. cd .. a few times until you find a directory that exists.

Tags:

Git