Mercurial Version Control - Command Line Tool
hg.exe is safe. It's the official Mercurial command-line interface. It runs as a lightweight executable that delegates heavy operations to the Python-based Mercurial runtime.
hg.exe is the Windows executable for the Mercurial version control system. It provides the command-line interface used to run Mercurial commands such as clone, commit, pull, and push. Hg.exe launches the Python-based Mercurial runtime and coordinates operations, often spawning subprocesses for network I/O and file operations, enabling reliable, isolated task execution.
This executable delegates most work to the Mercurial engine written in Python. On Windows, hg.exe manages command parsing, I/O, and subprocess orchestration, allowing operations to run with isolation and stable error handling.
Quick Fact: Mercurial's hg.exe acts as a launcher for commands; many operations are handled by the Python runtime, which helps keep the CLI responsive and stable.
Yes, hg.exe is safe when it's the legitimate file from Mercurial downloaded from official sources (mercurial-scm.org or the official installer).
The real hg.exe is NOT a virus. However, malware can disguise itself with similar names.
C:\Program Files\Mercurial\hg.exe or C:\Program Files (x86)\Mercurial\hg.exe. Any hg.exe elsewhere is suspicious.Red Flags: If hg.exe is located in unusual folders (like Temp or AppData\Roaming) or runs when you aren’t using Mercurial, or lacks a valid signature, scan with antivirus software. Beware of similarly-named files such as "hgconsole.exe".
hg.exe runs when you invoke Mercurial commands or when a tool integrates with Mercurial to perform repository operations in the background.
Reasons it's running:
Yes, you can disable hg.exe. It's safe to close terminal sessions when not in use, and you can uninstall Mercurial if you no longer need it.
If hg.exe is consuming excessive resources:
Quick Fixes:
1. Quick Fixes:
2. 1. Open a Mercurial command prompt and press Ctrl+C to cancel long operations
3. Limit open repositories to reduce concurrent activity
4. Disable unnecessary extensions in hgrc and remove unused ones
5. Update Mercurial to the latest version from mercurial-scm.org
6. Check for and apply memory-saving options in your repository configuration
No, the legitimate hg.exe from Mercurial is not a virus. However, always verify the file is located in C:\Program Files\Mercurial\hg.exe and has a valid digital signature from "Mercurial Project". Malicious files may use similar names.
High CPU usage is usually caused by specific operations on large repositories, or by misbehaving extensions. Use your terminal or Task Manager to identify the exact command; close or optimize the operation, update Mercurial, and check extensions for issues.
Yes, you can uninstall Mercurial via Windows Settings → Apps. Your repository data is separate; deleting hg.exe removes the CLI, but you can reinstall later from mercurial-scm.org.
Yes, you can close terminal sessions or disable startup items. To stop background operations, disable repository monitors or IDE integrations that call hg.exe.
Mercurial tools are not typically set to start automatically, but IDE integrations or server tools can launch hg.exe on Windows startup. Disable these in Task Manager > Startup.
Mercurial uses a modular command flow; certain operations may spawn subprocesses for I/O. Realistically, you should see one main hg.exe per active terminal; multiple independent processes indicate parallel tasks or tools.
Close unused repositories, disable unnecessary extensions, and update to the latest Mercurial. Consider performing large operations in smaller batches and using memory-saving settings where available.