Skip to content

Instantly share code, notes, and snippets.

@aras-p
Created September 3, 2013 18:44
Show Gist options
  • Save aras-p/6427926 to your computer and use it in GitHub Desktop.
Save aras-p/6427926 to your computer and use it in GitHub Desktop.
hg multiple heads, no problem

Say you're working on a branch and comitting from two machines. Your regular work:

hg commit -m "foobar"
hg push -r tip

Now, two cases:

  1. no merge or nothing needed.

// all is ok and push is fine

  1. merge or rebase is needed (someone else committed on the same branch)

i.e. hg push returned a "pushing a new head something something". so now you either merge or rebase your changes. I prefer rebase.

hg pull -b . --rebase
hg push -r tip

// done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment