Forrest logo
back to the hg tool

hg-commit:tldr:54115

hg-commit: Commit using the interactive mode.
$ hg commit --interactive
try on your machine

The command "hg commit --interactive" is used in Mercurial, a distributed version control system, to interactively commit changes to the repository.

When you run this command, Mercurial will go through each modified file and prompt you with a list of options for each change. You have the ability to review the changes, select which changes to include in the commit, modify commit messages, and more.

The interactive commit process typically involves the following steps:

  1. Mercurial presents a patch view, showing the changes that have been made to each file since the last commit.
  2. You can select different options for each change, such as "y" to include the change in the commit, "n" to exclude it, or "q" to quit the interactive commit process.
  3. You can also use additional options like "d" to see a unified diff of the change, or "e" to edit the commit message.
  4. After selecting the desired options for each change, Mercurial will proceed to create the commit with the chosen changes.

Using the "--interactive" flag allows you to have more control over the commit process, especially when dealing with multiple changes or when you want to review and selectively choose which changes to include in the commit.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the hg tool