all,
I have searched for this problem for long time and tried different methods.
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 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.
I also tried
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.
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!
Extraction from hg help urls
Some notes about using SSH with Mercurial:
- 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/repository
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.
Consequence of the quote and error message: you must to debug (with any ssh-tool) and find correct path to needed directory. you can:
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With