使用命令行克隆 git repo 成功,但使用 git GUI 客户端(例如 SourceTree)失败 [英] Cloning a git repo succeeds with the command line, but fails with a git GUI client (e.g. SourceTree)

查看:36
本文介绍了使用命令行克隆 git repo 成功,但使用 git GUI 客户端(例如 SourceTree)失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在 Mac OSX 10.7 系统上设置了一个 git 用户.在 git 用户的根目录中,我创建了一个 repositories 文件夹并初始化了一个名为 test 的裸 git repo.

I've set up a git user on a Mac OSX 10.7 system. In the git user's root, I've created a repositories folder and initialized a bare git repo named test.

到目前为止一切顺利.现在,我从与 Mac 位于同一网络的 PC 上克隆了该存储库

So far so good. Now, I clone the repo from a PC on the same network as the Mac with

git clone git@mac:repositories/test.git

这成功了.然后我可以从这个 repo 中推拉.一切看起来都不错.

This succeeds. I can then, push and pull from this repo. All looks good.

但是,当尝试使用 Atlassian SourceTree(一个 GUI git 客户端)做同样的事情时-失败:

But, when trying to do the same thing with Atlassian SourceTree - a GUI git client - this fails:

This is not a valid source path / URL

有人知道我做错了什么吗?

推荐答案

在这种情况下,您不需要用户名,因此源路径/URL"条目只是路径 repositories/test.git 您可以通过点击右侧的按钮看到这一点,该按钮提供了一个打开的文件对话框.

In this case you do not need a user name so the "Source Path/URL" entry is just the path repositories/test.git You would see this by hitting the button to the right which gives an open file dialog.

一个 URL 可能有效,但它的格式为 protocol::user@address/path 并且你必须在机器上运行一个服务器来响应请求(在这种情况下是一个 git 或 http 服务器)

A URL might work but that would be of a form protocol::user@address/path and you would have to have a server running on the machine to respond to the request (in this case a git or http server)

这篇关于使用命令行克隆 git repo 成功,但使用 git GUI 客户端(例如 SourceTree)失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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