Mild Fuzz
Mild Fuzz

Reputation: 30793

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, however, all GIT commands are met with:

fatal: Unable to read current working directory

Have I killed my repo? is this reversible?

Upvotes: 9

Views: 7065

Answers (2)

George P. Burdell
George P. Burdell

Reputation: 281

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.

Upvotes: 18

sehe
sehe

Reputation: 393709

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 .. :))

Upvotes: 8

Related Questions