Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to install Mercurial on Mac OSX 10.6, but I'm having problems:

  1. I have Mac OS X 10.6, so I downloaded Mercurial 1.4.3 for OS X 10.6 from http://mercurial.berkwood.com/
  2. I install the downloaded file mercurial-1.4.3+20100201-py2.6-macosx10.6.mpkg
  3. Than, I open Terminal and run hg --version to make sure it's installed. and it says

hg: command not found

How do I install Mercurial on Mac OS X 10.6?

share|improve this question

migrated from stackoverflow.com Feb 7 '10 at 13:29

This question came from our site for professional and enthusiast programmers.

    
It really says " hd : command not found" when you type " hg --version"? –  KennyTM Feb 6 '10 at 13:37
    
sorry, it says hg, not hd. my bad spelling at post. just edited. –  artmania Feb 6 '10 at 13:38
    
This is an installation issue, not a programming issue, so I think it goes in SuperUser. In any case, I just downloaded it for 10.5, double-clicked on the mpkg file, clicked on anything that said "Continue" or "Agree" or "Install", and it worked. I think step 2 needs more clarification before anybody can help you. –  David Thornley Feb 6 '10 at 13:44
    
at Terminal, do I have to be under any particular path to run this hg comments? or do I actually first have to run anything about Mercurial to make it work? or does it just works? –  artmania Feb 6 '10 at 13:50
add comment

3 Answers

Mercurial installs itself in /usr/local/bin, so the executable you want is /usr/local/bin/hg. You just need to add that directory to your PATH variable, i.e. do something like

export PATH="/usr/local/bin:$PATH"

somewhere in your shell profile (.profile, .bashrc, .zshrc).

PS: I only ever used Mercurial once, a week ago, and this particular information is displayed during installation, and again available as part of the package documentation. Not very hard to find :)

share|improve this answer
    
aha! after I run the comment you said, hg --version worked!! it said "Mercurial Distributed SCM (version 1.4.3+20100201) Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> and others. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." so, it means MErcurial is working? hmmm, now I need to find out more about Mercurial comments i guess –  artmania Feb 6 '10 at 14:06
    
whooaaa! do I have to do this export PATH="/usr/local/bin:$PATH" everything i need to work with mercurial? I closed Terminal, than opened again and hg didnt work again. after I make this export PATH="/usr/local/bin:$PATH", it worked. so this export comment is sth to run mercurial? do i have to do all the time? –  artmania Feb 6 '10 at 14:49
1  
as the OP noted, you need to put that line in your profile. If you don't know how to add it, just type this in a new terminal window "touch ~/.bash_profile && open -e ~/.bash_profile". That will open it up in text edit and you can paste the "export PATH..." command in there and save it. Open a new terminal window and you're good to go for all future terminal sessions. –  Ted Naleid Feb 6 '10 at 17:01
add comment

I had to do this:

go download the proper version of mercurial (mac didn't have it)

http://mercurial.selenic.com/downloads/

Make sure you grab the version of your MAc then not only make sure it's in your path like F'x said, but also make sure you have an alias set for it to execute from any directory:

alias hg=/path/where/mercurial/installed

for me it was

/usr/local/bin/hg

Hope this helps someone. It took me an hour to figure out.

share|improve this answer
add comment

For me, it wasn't the $PATH variable. That was already set to /usr/local/bin. However when I ran sudo su and performed ls -al /usr/local, bin was set only to 700 with "wheel" user. Though, probably not the most secure, I set this to chmod -R 755 /usr/local/bin and then I could run hg --version from any command line (as well as IntelliJ)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.