git无法识别远程存储库

时间:2015-07-27 17:39:13

标签: git ssh git-bash

这一切都是因为我希望将代码部署(并同步)到实时托管环境,对于我正在处理的网站(需要实际看到我正在做的更改) - 路由正在,{ {1}}

我在Windows上使用Bitbucket repo (code being worked on) -> local repo -> HostGator repo (results being visualized).。我在Git Bash中的HostGator上有一个名为“test”的git存储库 - 已配置且一切正常 - 我可以提交,分支等。 它们(HostGator)仅允许SSH连接上的public_html。我已经创建了一个本地空存储库,然后将远程存储库添加到远程存储库列表中,如下所示:

port 2222 这是因为,尽我所能,我无法通过SSH来读取和应用我的本地配置文件。

然后测试一切正常我试过:

git remote add localName ssh://username@address:2222/public_html/test

这会连接,要求输入密码,然后失败并显示git ls-remote ssh://username@address:2222/public_html/test消息。我检查了权限,一切都很好。

问题是:为什么它会失败并且无法识别存储库?这是我路径中的东西,我添加远程仓库的方式吗?

编辑:经过进一步调查,即使目录public_html/test is not a git repository是存储库且包含.git文件夹,test也会显示没有“.git”的结束路径'extension' - “public_html / test”而不是“public_html / test.git”,其次是存储库的正常情况。这让我相信添加它的语法是不正确的。

1 个答案:

答案 0 :(得分:1)

HostGator中的public_html文件夹位于HostGator帐户主目录中。请参阅“public_html folder”:

http://support.hostgator.com/img/articles/file-manager-home-directory.png

尝试并指定完整路径:

git remote add localName ssh://username@address:2222/home/username/public_html/test

话虽如此,最好是:

我的意思是,你可以push to a non-bare repo(如果服务器上的Git最近足够2.3+),但最好的做法仍然是一个简单的回购。

相关问题