Git clone fatal: ‘origin’ does not appear to be a git repository for VMware vmhgfs share

gitvmware

I'm getting this "fatal: 'origin' does not appear to be a git repository" error while doing git clone (go get) .

$ git clone https://github.com/andybalholm/cascadia /path/to/Go/src/github.com/andybalholm/cascadia
Cloning into '/path/to/Go/src/github.com/andybalholm/cascadia'...
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

The existing answers I found from SO are either about git push (with wrong .gitconfig) or having the wrong permission, which I've double checked to have rule it out.

I never had such problem before, but this is a brand new Ubuntu 16.04 LTS Xenial machine, and I'm using the Ubuntu official go1.6 for the first time as well.

let me first insist that this is not the wrong permission problem, as I've created /path/to/Go/src/github.com/andybalholm/cascadia myself without any problem.

However, further investigate confirmed that it is in fact the wrong permission problem — My Ubuntu 16.04 is in VM, and its vmhgfs share somehow allows me but not git command to operate in there.

So, once again,

  • Ubuntu 15.04, with VMware's own VMware Tools, git clone into vmhgfs share works fine.
  • Ubuntu 16.04, with open-vm-tools-desktop, git clone into vmhgfs share won't work, error as reported above.

Anyone know any workaround? Thanks

Best Answer

I had the same problem, also in a VM (although Ubuntu 14.04 under VMWare Workstation). The problem was a permissions problem between my Ubuntu VM guest user and my Windows host user. Although on the VM I can create directories and files on the Windows file system mounted within the VM, the "go get" had the same error you did.

I did not get the error if I ran "go get" in a VM local directory (~/golang for example).

I don't know yet how to fix the permissions issues (sudo didn't help) or where in the stack the permissions problems are occurring. As a work-around, I run "go get" in my local VM directory (~/golang) and then move or copy the created files into the go directory I want them in on my mounted file system.