从Mac OS X上的Windows共享文件夹上托管的克隆git回购(Clone git repo hosted on a Windows shared folder from Mac OS X)

编程入门 行业动态 更新时间:2024-10-27 15:18:17
从Mac OS X上的Windows共享文件夹上托管的克隆git回购(Clone git repo hosted on a Windows shared folder from Mac OS X)

我在Windows共享文件夹上托管一个git remote repo。 我用它克隆它:

git clone //git-host-pc/SharedFolder/MyProject/

这个命令可以在Windows PC上运行,但在Mac上,我得到这个错误:

fatal: repository '//git-host-pc/SharedFolder/MyProject' does not exist

试着git clone smb://git-host-pc/SharedFolder/MyProject给了我这个错误 - fatal: Unable to find remote helper for 'smb' 。

注意:我发现这个问题在我之前已经被问到了 - 在osx的windows共享中使用git repos ,但是OP没有提供他的确切命令或者错误消息,这就是为什么他的问题没有得到答案。

编辑:我忘了提及,但共享文件夹从Mac可见,我可以在Finder中看到它。

I host a git remote repo on a Windows shared folder. I clone it using:

git clone //git-host-pc/SharedFolder/MyProject/

This command works from a Windows PC, but on a Mac, I get this error:

fatal: repository '//git-host-pc/SharedFolder/MyProject' does not exist

Trying git clone smb://git-host-pc/SharedFolder/MyProject gives me this error - fatal: Unable to find remote helper for 'smb'.

Note: I've found this question has been asked before mine - Use a git repos on a windows share from osx, however the OP there hasn't provided his exact commands, or the error messages, and that's why his question is unanswered.

Edit: I forgot to mention, but the shared folder is visible from the Mac, I can see it in Finder.

最满意答案

我有点像以为远程文件系统访问是一个操作系统的事情,克隆回购是一个应用程序级别的事情,所以这是我的方法:

您应该能够将该操作系统的SMB功能安装到本地目录并从那里克隆,而不是希望git为SMB提供传输。

如何安装:

连接到Mac上的服务器。 现在,在您的Mac上,从Finder的转到菜单中选择“连接到服务器”。 输入您刚从PC获得的IP地址,前面加上smb://,如下所示:

在这里输入图像描述

更新:要使用您的PC的名称而不是IP地址,请用名称替换该号码。 所以如果你的电脑名称是“MyWindowsBox”,你可以使用smb:// mywindowsbox(不区分大小写)。

如果找到您的服务器,系统会提示您输入网络凭据 - 默认情况下,您的Windows用户名和密码为:

在这里输入图像描述

在哪里可以找到安装的文件夹:

一旦我以这种方式安装了//git-host-pc/SharedFolder ,我在/Volumes/SharedFolder找到了它。

I kind of like to think that remote file system access is an OS thing, and that cloning repos is an application-level thing, so this would be my approach:

You should just be able to mount that SMB share with your OS'es functions to a local directory and clone from there, instead of hoping git has a transport for SMB.

How to mount:

Connect to the server on your Mac. Now, on your Mac, from Finder's Go menu, choose "Connect to Server." Enter the IP address you just obtained from your PC, preceded by smb://, as shown:

enter image description here

UPDATE: To use your PC's name instead of IP address, replace the number with the name. So if your PC's name is "MyWindowsBox", you'd use smb://mywindowsbox (not case-sensitive).

If it finds your server, you'll get prompted to enter your network credentials - by default, your Windows username and password:

enter image description here

Where to find the mounted folder:

Once I mounted the //git-host-pc/SharedFolder in that way, I found it in /Volumes/SharedFolder.

更多推荐

本文发布于:2023-08-06 12:50:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1448656.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:共享文件夹   git   Windows   Mac   OS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!