我在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 existTrying 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:
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:
Where to find the mounted folder:
Once I mounted the //git-host-pc/SharedFolder in that way, I found it in /Volumes/SharedFolder.
更多推荐
发布评论