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

后端 未结 2 868
名媛妹妹
名媛妹妹 2021-02-18 13:23

I\'m a Windows 10 user, using gitbash as a command prompt.

After I changed the branch to master, suddenly I\'m struck with this error message.



        
相关标签:
2条回答
  • 2021-02-18 13:40

    I got this message when trying to execute git commands in crosh on a chromebook. 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.

    0 讨论(0)
  • 2021-02-18 13:41

    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.

    0 讨论(0)
提交回复
热议问题