Posts for Tag: Mercurial

Share a Mercurial repository on github (macOS)

Local macOS configuration

Python & Mercurial

This was tested on macOS El Capitan, with Pyhton 2.7 and Mercurial 4.2.2

Install Hg-Git

You will need the Hg-Git Mercurial plugin.

It can be installed with Python's package installer pip.

Install pip first:

$ wget
$ python

Install Mercurial (eventually) & Hg-Git:

$ sudo pip install mercurial
$ sudo pip install hg-git

Enable the extension:

$ vi ~/.hgrc:

hggit =

SSH key for github

create SSH key (details)

  • ssh-keygen -t rsa -b 4096 -C ""

add it to your github account (details)

  • $ pbcopy < ~/.ssh/
  • Github: Settings -- SSH / GPG Keys -- New SSH key -- paste clipboard

Configure & share repository

create empty github repository

  • create on github
  • copy its URL
configure local empty repository
$ mkdir myrepo
$ cd myrepo
$ hg init

set username & include github URL as default 
$ vi .hg/hgrc

username = Someone Example

default = git+ssh://

Push & pull

Upload local changes to github

hg addremove
hg commit
hg bookmark -r default master
hg push

Integrate locally changes made on github

hg pull -u