HG(BRANCH)

🌸 HG(BRANCH) β€” like, the whole manual page, bestie 🌸

okay so this is the hg branch page from the Mercurial manual, and we're gonna get through it together, no skipping, promise πŸ’–


✨ NAME ✨

hg branch β€” set or show the current branch name πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

hg branch [-fC] [NAME]

that's it. that's the whole vibe. short king behavior honestly πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

⚠️ not me dropping the most important thing first: branch names are permanent and global. like, forever. no take-backsies. if you want something light and swappable, use hg bookmark to make a light-weight bookmark instead. and if you wanna actually understand named branches vs bookmarks, go read hg help glossary, it's giving study session πŸ“š

With no argument, it just shows you the current branch name. With one argument, it sets the working directory branch name β€” and heads up, the branch won't exist in the repository until the next commit. so it's like, a promise, not a fact yet. ✨

Standard practice (iykyk) recommends that your primary development happens on the 'default' branch. that's the main character branch fr fr.

Unless you pass -f/--force, branch will not let you set a branch name that already exists. it said no duplicates, periodt.

Use -C/--clean to reset the working directory branch back to that of the parent of the working directory β€” basically it undoes a previous branch change. unbothered, moisturized, back to parent πŸ§–

Use the command hg update to switch to an existing branch. Use hg commit --close-branch to mark this branch head as closed. And when all heads of a branch are closed, the branch will be considered closed. that's the whole branch, gone, closed, bye πŸ‘‹

Returns 0 on success. slay βœ…


πŸ’… OPTIONS πŸ’…

  • -f, --force β€” set branch name even if it shadows an existing branch. yes, it's the "i heard you the first time" flag 😭
  • -C, --clean β€” reset branch name to parent branch name. rewind moment πŸŒ€
  • -r, --rev <VALUE[+]> β€” change branches of the given revs. this one is (EXPERIMENTAL) so like, tread carefully bestie, it's still in its testing era πŸ§ͺ
[+] β€” a marked option can be specified multiple times. so yes, stack it, stack it, stack it 🫢

and that's the whole page!! every flag, every warning, every hg command, all of it, untouched, just narrated with love πŸ’œ

this has been the HG(BRANCH) manual page, brought to you by the Mercurial manual itself. mwah, go commit something cute πŸ’–βœ¨πŸŽ€