Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TortoiseHg: ‘hg’ is not recognized as an internal or external command, operable program or batch file

I'm unable to find the command line tools in Mercurial-TortoiseHg version 2.7.2. I checked for hg.exe file and it is present at C:\Program Files\TortoiseHg path but whenever I try running the command it fails and throws the error :

‘hg’ is not recognized as an internal or external command, operable program or batch file.

I have also added it to the windows PATH= ; C:\Program Files\TortoiseHg.

Not sure what else to look for. Please help.

like image 769
buggydroid Avatar asked May 06 '13 12:05

buggydroid


2 Answers

Notes:

  • As mentioned in "Mercurial not working after TortoiseHg update", TortoiseHg v2.X.X no longer uses the hg command, but rather thg.
    That means your PATH might not be updated properly to reference hg.exe of TortoiseHg.
  • to update your PATH, make sure not add any extra space:
set PATH=%PATH%;C:\Program Files\TortoiseHg

(no space between ';' and 'C:\...')

As mentioned by the OP Sowmya Guru, if you modify the user environment variable, a restart (or at least a new DOS windows) is necessary.

like image 56
VonC Avatar answered Nov 12 '22 17:11

VonC


Posting my answer related to vanilla Mercurial install (not 'TortoiseHg') as it was the first page in search results, my solution was to use the 'Mercurial-3.4 (64-bit msi)' installer instead of the 'Mercurial-3.4 (64-bit exe)' from this page.

like image 36
Daniel Sokolowski Avatar answered Nov 12 '22 16:11

Daniel Sokolowski