windows - 如何从局域网内的其他电脑在 windows 中 git clone 一个 repo?

标签 windows git repository clone lan

我的主 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/

相关文章:

c# - 创建新线程时,不对 GUI 进行更改 (C#)

windows - 在 Git for windows "git bash"中,如何使用 cmd 和 Windows 资源管理器使用的 Windows 路径格式中的 "print working directory"?

visual-studio - 来回切换 Git 分支后如何避免 Visual Studio 重建?

java - 分离的实体传递到持久化 : Profile

mercurial - 如何从 TortoiseHG 设置默认推/拉存储库

c++ - 从未调用过 WSASend 完成例程

windows - Leiningen 无法处理新生成的项目

C# ML.Net 图像分类 : Does GPU acceleration help improve the performance of predictions and how can I tell if it is?

没有换行符,Git 别名无法回显

c# - 存储库中添加和更新方法的特定实体对象