问题
Every time I pull from a repository I get not only the changesets but also all the bookmarks from that repository. In some situations this is quite annoying. Is there a way to pull without getting bookmarks?
(I'm actually using TortoiseHG, but information about plain Mercurial command line is useful and appreciated as well.)
(Background: In TortoiseHG having many bookmarks gets cluttered quickly. That doesn't matter in the remote repository where the bookmarks should remain for future reference. But locally I don't need or want them. So after each pull from the remote repository I have to delete each bookmark individually. This gets old fast...)
回答1:
I don't think that push copies bookmarks, so why not go to the remote repository and from there push into yours?
Alternatively, .hg/bookmarks is just a text file, what happens if you copy it, pull, and then restore the original?
回答2:
Is there a way to pull without getting bookmarks?
No. You get all remote bookmarks from remote repository every time
In TortoiseHG having many bookmarks gets cluttered quickly
How?! Not active "external" bookmark will remain invisible in the past history quickly
but... you can rename your local, important bookmarks (give some unique prefix) and after it deleting remote bookmarks after each pull can be a lot easier: grep -v PREFIX for content of .hg/bookmarks file
来源:https://stackoverflow.com/questions/31377026/can-mercurial-pull-without-getting-bookmarks