2

The repo had been working fine until I tried to view the source with VS Code though NFS.

Git status and checkout work, but pretty much nothing else. I'm not able to push anything to remote, and there's a lot of local changes. How should I go about repairing the repo (hoping for not having to move diffs as last resort)? Thanks in advance!

$ git status
On branch <branch>
...
nothing to commit, working directory clean

$ git log
fatal: Not a git repository: <repo path>

$ echo $GIT_DIR
<repo root correct>

$ ll -dn $GIT_DIR/.git
drwxr-xr-x 7 <UID correct> <GID correct> 4.0K Sep  9 14:55 <repo root>/.git
1
  • 2
    If git status works, git log should work, and vice versa. The usual case is something getting messed up with the file named .git/HEAD, but that would break git status too. Commented Sep 10, 2018 at 0:14

2 Answers 2

1

How should I go about repairing the repo?

You can check first if copying the all repo to a local folder (ie removing the NFS access) will result in a working repo.

Another approach is to clone that repo again, locally, and report your current work in progress to it.

Once you have a working repo locally, you can try and clone it again through your NFS share.

Sign up to request clarification or add additional context in comments.

Comments

0

Check the access rights to files within the .git directory (ls -lR .git)

Depending on the git commands which were executed by VS Code through NFS, it is pretty possible that only some files ended up with bad rw access.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.