How do I delete a remote bookmark in Mercurial?

12,288

Solution 1

To delete a bookmark from a remote server, you must have permission to push to the server. If you can push to it, then you can:

hg bookmark --delete <bookmark name>
hg push --bookmark <bookmark name>

See the "Working With Remote Repositories" section of the Mercurial BookmarksExtension wiki for further info.

NOTE: This only removes the bookmark itself. It does not remove any changesets that were associated with the bookmark. If you need to remove the changesets themselves, then you must consider other methods as noted in these related questions.

Solution 2

With hg-git it is not possible at the moment.

You have to install the git client, clone the repo and issue a

git push origin :oldbranch

to delete the old branch. Hopefully there will be a patch one day.

Share:
12,288
Lambda Fairy
Author by

Lambda Fairy

I like ducks. Here are some ducks. If you like ducks, please visit my website.

Updated on June 15, 2022

Comments

  • Lambda Fairy
    Lambda Fairy about 2 years

    I can delete remote branches in Git using git push. (See How do I delete a remote branch in Git?). But I can't do the equivalent using Mercurial bookmarks.

    I've tried hg bookmark -d something, but when I push to a Git repository using hg-git, it does not delete the bookmark on the remote repository.

    When I try hg bookmark -d origin/something, it complains that it doesn't exist.