Mercurial:远程:abort:这里没有Mercurial存储库(未找到.hg)! [英] Mercurial: remote: abort: There is no Mercurial repository here (.hg not found)!

查看:190
本文介绍了Mercurial:远程:abort:这里没有Mercurial存储库(未找到.hg)!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全部

我很久以来一直在寻找这个问题,并尝试了不同的方法.

I have searched for this problem for long time and tried different methods.

我想仅通过SSH在服务器上维护我的代码.但是当我运行它时:

I want to maintain my code on the server through only SSH. But when I run this:

sudo hg clone -v ssh://carl@hostname//home/carl/Java/Projects/peta/

Mercurial一直告诉我remote: abort: There is no Mercurial repository here (.hg not found)!.一些文章说该路径应该正确,并且那里应该有一个.hg目录.但是我已经检查了好几次,而且我确定在正确的位置有一个.hg文件夹.

Mercurial keeps telling me remote: abort: There is no Mercurial repository here (.hg not found)!. Some articles said that the path should be correct and there should be a .hg directory there. But I have checked it for several times and I am sure there is a .hg folder at the right place.

我也尝试过

hg --config ui.remotecmd=/usr/bin/hg clone ssh://carl@hostname//home/carl/Java/Projects/peta/

但是它也失败了.还有什么其他问题?谢谢.

But it failed as well. What other problem it could be? Thanks.

我终于解决了这个问题.以前,我在本地计算机上创建一个存储库,然后将所有文件(包括.hg)都存储到服务器上.我尝试先删除.hg目录,然后通过ssh(hg init)在服务器上创建一个存储库.然后hg clone可以工作!

I finally fix the problem. Previously, I create a repository on my local machine, and scp all files (including .hg) on to the server. I try to remove .hg directory first, and create a repo on the server through ssh (hg init). Then hg clone works!

推荐答案

hg help urls

关于将SSH与Mercurial一起使用的一些说明:

Some notes about using SSH with Mercurial:

  • SSH需要在目标计算机上具有可访问的外壳程序帐户,并且 远程路径中hg的副本,或指定为remotecmd.
  • 默认情况下,
  • 路径是相对于远程用户的主目录的.使用 路径开头的额外斜杠以指定绝对路径:

  • SSH requires an accessible shell account on the destination machine and a copy of hg in the remote path or specified with as remotecmd.
  • path is relative to the remote user's home directory by default. Use an extra slash at the start of a path to specify an absolute path:

ssh://example.com//tmp/存储库

ssh://example.com//tmp/repository

这至少意味着,您不能使用相同的URI ,并且只能对其进行一个/两个斜杠修改:至少不存在一条路径.

this means, at least, that you can't use the same URI and change only one/two slash it it: at least one path will be non-existent.

引用和错误消息的后果:您必须进行调试(使用任何ssh工具)并找到所需目录的正确路径.您可以:

Consequence of the quote and error message: you must to debug (with any ssh-tool) and find correct path to needed directory. you can:

  • 使用scp(f)并从已知位置复制已知文件
  • 在交互式会话中通过SSH进入远程主机并手动验证路径(均为?),即ssh ...,cd ...,pwd,验证pwd的输出
  • ...任何其他调试器

登录后获得良好路径时,您必须检查下一个故障点-.hg目录权限

When you'll get good path after login, you have to check next point of failure - .hg dir permissions

在验证了这些检查点之后,您将获得克隆和一些加成,其形式为了解以前发生了什么"

After verification of these checkpoints you'll get clone and some bonus in the form of understanding "What happened before"

HTH

这篇关于Mercurial:远程:abort:这里没有Mercurial存储库(未找到.hg)!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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