我的主 PC 中有这个 git 存储库“c:/xampp/htdocs/**”,它的 IP 地址是 192.168.0.6。现在我想从 ubuntu-server git clone 这个 repo,它在我的主 PC 的 Vmware Player 上运行。
我做了
git clone \\192.168.0.6\c:\xampp\htdocs\****
和
git clone //192.168.0.6/c:/xampp/htdocs/****
来自 ubuntu-server,但均无效。
fatal: could not create work tree dir '****'.: Permission denied
我做错了什么? 我该怎么办?
最佳答案
您应该使用命令 git daemon
托管您的存储库,如下所示:
在您充当服务器的计算机中:
git daemon --base-path=<path_to_folder_containing_project_folder> --export-all
(请注意 path_to_folder_containing_project
是包含您的项目文件夹的文件夹,它将提供该文件夹下的所有项目)
在您的客户端中:
git clone git://<local ip>/<project name>
克隆的 repo 将其来源指向您 LAN 中的服务器,因此您可能需要使用 git remote set-url origin
将其指向原始原点。
您可能想要运行 git daemon
与 --verbose
在遇到问题时获取更多详细信息的选项。
关于windows - 如何从局域网内的其他电脑在 windows 中 git clone 一个 repo?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5200181/