hg Verified current stable Not installed? Version Control

Hg / Push Changes To Specified Repository

Push Changes To Specified Repository

Push committed changes to a specified repository.

$
Terminal
hg push <path/to/destination_repository>

When To Use

During deployment to ensure the latest changes are propagated to the production repository.

Pro Tip

Use the "--force" flag with caution; it can overwrite changes in the destination repository.

Anatomy of Output

Understanding the result

pushing to https://repository.example.com/repo Destination Repository

The URL for the repository being targeted.

searching for changes Status

Indicates that transfer processes are underway.

1 changesets pushed Changesets Pushed

Indicates the number of changeset transmissions.

Power User Variants

Optimized versions

hg push --force

Force push to overwrite remote changes.

hg push -r {revision}

Push a specific revision to the remote repository.

Troubleshooting

Common pitfalls

abort: no changes to push

Solution: Verify that there are committed changes in the local repository.

abort: repositories have diverged

Solution: Pull latest changes from the destination before pushing.

abort: permission denied

Solution: Check repository permissions and credentials.

Command Breakdown

What each part is doing

hg
Base Command
The executable that performs this operation. Here it runs Hg before the shell applies any redirect operators.
<path/to/destination_repository>
path to destination repository
The value supplied for path to destination repository.

Alternative Approaches

Comparable commands in other tools

Alternative version control tools for the same job.