从Mac OS X克隆Windows共享文件夹上托管的git repo [英] Clone git repo hosted on a Windows shared folder from Mac OS X

查看:113
本文介绍了从Mac OS X克隆Windows共享文件夹上托管的git repo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows共享文件夹上托管git远程存储库.我使用以下方法克隆它:

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

此命令可在Windows PC上运行,但是在Mac上,我收到此错误:

致命:存储库'//git-host-pc/SharedFolder/MyProject'不存在

尝试 git clone smb://git-host-pc/SharedFolder/MyProject 给我这个错误-致命:无法找到'smb'的远程助手.

注意::我发现这个问题是在我之前问过的-

更新:要使用PC的名称代替IP地址,请用名称替换数字.因此,如果您的PC名称为"MyWindowsBox",则可以使用smb://mywindowsbox(不区分大小写).

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

在哪里找到挂载的文件夹:

以这种方式安装//git-host-pc/SharedFolder 之后,我在/Volumes/SharedFolder 中找到了它.

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.

解决方案

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.

这篇关于从Mac OS X克隆Windows共享文件夹上托管的git repo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆