HG(PUSH)

πŸ’– hg push β€” the manual page, but make it make sense πŸ’–

okay bestie, welcome to the HG(PUSH) page. yes that's the header, yes it's also the footer, we contain multitudes. sit down, grab a strawberry πŸ“, and let's learn how to yeet your commits into the void (the void is a remote repo, it's fine).


✨ NAME ✨

hg push β€” push changes to the specified destination


🌈 SYNOPSIS 🌈

hg push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]...

πŸ‘‘ DESCRIPTION πŸ‘‘

So. You've got changesets sitting in your local repository, and you want them to be somewhere else. That's push. You're literally pushing changesets from the local repo to the destination you name. main character energy.

The tea: this operation is symmetrical to pull. Like, it is identical to doing a pull in the destination repository from the current one. Same thing, different direction. the way that works is honestly iconic.

Now here's the part where I hold your hand 🫢 β€” by default, push will not let you create new heads at the destination. why? because multiple heads make it unclear which head to use, and that's a whole mess nobody asked for. If you find yourself in that situation, the recommended move is to pull and merge before pushing. do that. please.

Wanna allow push to create a new named branch that isn't present at the destination yet? Use --new-branch. This lets you create just the new branch without forcing other changes. slay.

⚠️ Not me warning you about -f/--force: extra care should be taken with the -f/--force option, because it will push all new heads on all branches. That action will almost always cause confusion for collaborators. like, genuinely. chaos. πŸ’€

If -r/--rev is used, the specified revision and all its ancestors will be pushed to the remote repository. the whole family tree, we're bringing everybody.

If -B/--bookmark is used, the specified bookmarked revision, its ancestors, and the bookmark get pushed to the remote repository. Specifying . is equivalent to specifying the active bookmark's name. And if you want all the current bookmarks pushed, that's what --all-bookmarks is for.

Please see hg help urls for important details about ssh:// URLs. iykyk. And if DESTINATION is omitted, a default path will be used. no thoughts, just defaults.

When passed multiple destinations, push will process them one after the other β€” but it will stop should an error occur. one bad apple and we're out. 🍎

The --pushvars option sends strings to the server that become environment variables prepended with HG_USERVAR_. For example, --pushvars ENABLE_FEATURE=true provides the server side hooks with HG_USERVAR_ENABLE_FEATURE=true as part of their environment. cute, right?

pushvars can provide for user-overridable hooks as well as set debug levels. One example is having a hook that blocks commits containing conflict markers, but enables the user to override the hook if the file is using conflict markers for testing purposes or the file format has strings that look like conflict markers. very "it's giving flexibility".

By default though, servers will ignore --pushvars. To enable it, add the following to your configuration file:

[push]
pushvars.server = true

And the receipts: Returns 0 if push was successful, 1 if nothing to push. πŸ“‹


πŸ’… OPTIONS πŸ’…

  • -f, --force β€” force push
  • -r, --rev <REV[+]> β€” a changeset intended to be included in the destination
  • -B, --bookmark <BOOKMARK[+]> β€” bookmark to push
  • --all-bookmarks β€” push all bookmarks (EXPERIMENTAL)
  • -b, --branch <BRANCH[+]> β€” a specific branch you would like to push
  • --new-branch β€” allow pushing a new branch
  • --pushvars <VALUE[+]> β€” variables that can be sent to server (ADVANCED)
  • --publish β€” push the changeset as public (EXPERIMENTAL)
  • -e, --ssh <CMD> β€” specify ssh command to use
  • --remotecmd <CMD> β€” specify hg command to run on the remote side
  • --insecure β€” do not verify server certificate (ignoring web.cacerts config)

[+] marked option can be specified multiple times


okay that's literally the whole page, you ate that πŸŽ€ go forth and push responsibly (or don't, but don't blame me). this has been the HG(PUSH) manual page, source and all, top and bottom, same title twice because that's just how manpages are built β€” signed off with love, dated whenever your terminal felt like it, and yes, the footer is still HG(PUSH). bye bestie πŸ¦‹βœ¨