HG(BOOKMARKS)

πŸ’– hg bookmarks πŸ’–

okay bestie, listen β€” this is the hg bookmarks page from the Mercurial manual and it's genuinely one of the most useful ones, no cap. πŸŽ€


✨ NAME ✨

hg bookmarks β€” create a new bookmark or list existing bookmarks πŸ¦‹


🌸 SYNOPSIS 🌸

hg bookmarks [OPTIONS]... [NAME]...

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so, bookmarks are literally just labels on changesets to help you track lines of development. that's the whole vibe. 🏷️

bookmarks are unversioned β€” meaning they're not part of the repo history at all β€” and they can be moved, renamed and deleted whenever you want. and here's the part that lowkey blows people's minds: deleting or moving a bookmark has no effect on the associated changesets. the changesets are fine. they're safe. the bookmark was just a lil sticky note on top. πŸ’…


⭐ the active bookmark situation ⭐

creating a bookmark or updating to one causes it to be marked as 'active'. the active bookmark shows up with a '*' next to it β€” that's your main character indicator, periodt. πŸ‘‘

when you make a commit, the active bookmark advances to the new commit. a plain hg update will also advance an active bookmark, if possible. and if you update away from a bookmark? it gets deactivated. sorry girl, you left. πŸ’€


🌈 pushing, pulling & divergence 🌈

bookmarks can be pushed and pulled between repositories (peep hg help push and hg help pull). ✨

but if a shared bookmark has diverged, a new 'divergent bookmark' of the form 'name@path' gets created. the way to fix that? using hg merge will resolve the divergence. slay. 🫢


πŸ™ˆ the . shortcut πŸ™ˆ

specifying a bookmark as '.' to the -m/-d/-l options is equivalent to specifying the active bookmark's name. so you don't even gotta type it out. iykyk. πŸ’…


πŸŽ€ the special '@' bookmark πŸŽ€

a bookmark named '@' has the special property that hg clone will check it out by default if it exists. it's giving VIP. it's giving default-branch energy. πŸ‘‘


🧚 Template 🧚

the following keywords are supported in addition to the common template keywords and functions such as {bookmark}. see also hg help templates. 🌸

  • active β€” Boolean. True if the bookmark is active.

πŸ“ Examples πŸ“

  • create an active bookmark for a new line of development:
hg book new-feature
  • create an inactive bookmark as a place marker:
hg book -i reviewed
  • create an inactive bookmark on another changeset:
hg book -r .^ tested
  • rename bookmark turkey to dinner:
hg book -m turkey dinner
  • move the '@' bookmark from another branch:
hg book -f @
  • print only the active bookmark name:
hg book -ql .

πŸ’œ OPTIONS πŸ’œ

  • -f, --force β€” force. that's it. that's the description. it forces. πŸ’ͺ
  • -r, --rev <REV> β€” revision for bookmark action
  • -d, --delete β€” delete a given bookmark
  • -m, --rename <OLD> β€” rename a given bookmark
  • -i, --inactive β€” mark a bookmark inactive
  • -l, --list β€” list existing bookmarks
  • -T, --template <TEMPLATE> β€” display with template

πŸ¦‹ ALIASES πŸ¦‹

bookmark

so yeah, you can just type hg bookmark and it hits the exact same. shorter, cuter, same energy. ✨


okay bestie that's the whole page, no notes, you ate it up fr fr. πŸŽ€ this lil manual page lives under the HG(BOOKMARKS) title and honestly the version/date info is right there in that footer vibe β€” that's all the source and date deets this one's got, so consider it acknowledged and blessed. go forth and bookmark everything. πŸ’–βœ¨πŸ¦‹πŸŒΈπŸ‘‘