9
1
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
3Yep, exactly the way I solve it as well. Thanks, and, Oh, welcome aboard! – xpt – 2016-06-09T13:36:13.793
Here's another piece to the puzzle. Try this...init a new repo, then add a remote to it. E.g.,
git remote add origin uri
. Now take a look at the.git/config
file. It shows the remote and the fetch-spec, but not the url key. I.e., by any means I can discover, it's impossible to successfully add a URI-based remote when the repo is on an affected vmhgfs share. I think it's a pretty reasonable guess that this behavior is the underlying cause of thegit clone
failure. I observed this in Ubuntu 16.04 with git 2.7.4 and git 2.13.0. – John Fultz – 2017-07-01T21:38:15.677Thanks a lot! very weird issue. Maybe something related or the same problem as this?
– PieCot – 2018-06-25T20:24:52.527