git clone 致命:'origin' 似乎不是 VMware vmhgfs 共享的 git 存储库

xpt*_*xpt 8 vmware git

fatal: 'origin' does not appear to be a git repository在执行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.
Run Code Online (Sandbox Code Playgroud)

我从 SO 找到的现有答案要么是关于 git push(错误的 .gitconfig)要么是权限错误,我已经仔细检查过以排除它。

我以前从来没有遇到过这样的问题,但这是一台全新的 Ubuntu 16.04 LTS Xenial 机器,我也是第一次使用 Ubuntu 官方 go1.6。

首先让我坚持认为这不是错误的权限问题,因为我自己创建的/path/to/Go/src/github.com/andybalholm/cascadia没有任何问题。

然而,进一步调查证实,这实际上是错误的权限问题——我的 Ubuntu 16.04 在 VM 中,它的 vmhgfs 共享以某种方式允许我但不允许git命令在那里操作。

所以,再一次,

  • 使用 VMware 自己的 VMware Tools 的 Ubuntu 15.04git clone进入 vmhgfs 共享工作正常。
  • Ubuntu 16.04,带有open-vm-tools-desktop,git clone进入 vmhgfs 共享将不起作用,错误如上报告。

任何人都知道任何解决方法?谢谢

小智 12

我也遇到了同样的问题,也在 VM 中(尽管 VMWare Workstation 下的 Ubuntu 14.04)。问题是我的 Ubuntu VM 来宾用户和我的 Windows 主机用户之间的权限问题。虽然在虚拟机上我可以在虚拟机内安装的 Windows 文件系统上创建目录和文件,但“go get”有与您相同的错误。

如果我在 VM 本地目录(例如 ~/golang)中运行“go get”,我没有收到错误消息。

我还不知道如何解决权限问题(sudo 没有帮助)或权限问题发生在堆栈中的哪个位置。作为一种解决方法,我在本地 VM 目录 (~/golang) 中运行“go get”,然后将创建的文件移动或复制到我希望它们在我挂载的文件系统中的 go 目录中。

  • 是的,正是我解决它的方式。谢谢,哦,欢迎登机! (3认同)