开发者

Error with GIT after importing changes from a server

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜