开发者

Error with GIT after importing changes from a server

开发者 https://www.devze.com 2023-02-28 01:11 出处:网络
I was trying to establish why a function on a website worked locally but not remotely, so my idea was to download the remote site and do a git diff in order to spot any differences.

I was trying to establish why a function on a website worked locally but not remotely, so my idea was to download the remote site and do a git diff in order to spot any differences.

Since I did this, howev开发者_Python百科er, all GIT commands are met with:

fatal: Unable to read current working directory

Have I killed my repo? is this reversible?


I've run into this problem a few times. As silly as it may sound, closing the terminal window (or SSH session) and opening a new one solves the problem.


In your shell issue

cd "$PWD"

My guess is it doesn't exist/has been recreated. This happens also with dangling symlinks.

Otherwise, retreat to higher ground. Note, that depending on your shell cd .. will or will not work (if the shell optimizes it, knowing the CWD, it may work, otherwise you'll be catch-22: the shell cannot lookup the inode for .. :))

0

精彩评论

暂无评论...
验证码 换一张
取 消