UFC Insider
UFC Insider

Reputation: 838

How to change pull location on Mercurial

I use mercirual and I cloned a remote repository. It created a new folder an inside it the .hg folder. But now when I enter hg pull in the command line, it says the .hg folder is not found inside Mercurial folder (that's because the clone function created another folder first).

How do I deal with that? Is there a way to change the pull location?

Upvotes: 1

Views: 664

Answers (2)

planetmaker
planetmaker

Reputation: 6044

err what? You usually are not supposed to manually modify the contents of the .hg folder with the exception of .hg/hgrc.

However, the repo's config file has a section which allows to set the pull and push location(s):

[paths]
default = path_or_URL/to/default/repo
othername = path/to/other/repo
pushurl = path_or_URL/to/default/repo/to/push/to

In the setup as above, the default pull and push should be clear, and there's another name defined, othername, which you can also simply refer to in commands which require a repo name. For instance you can push to it by using:

hg push othername

Check out hg help config for more details.

Upvotes: 1

alexis
alexis

Reputation: 50220

Let's see if I got this right: You did hg clone ssh://example.com/some/project, and it created a folder project, right?

You don't need to change the pull path, it's set correctly. What you need to do is type

cd project

Then you'll be inside your project folder, and you'll be able to use mercurial commands the way you expect.

Upvotes: 0

Related Questions