Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TortoiseHg and GitHub.com

Read-only access, in short

First,

hg clone http://bitbucket.org/durin42/hg-git HGGIT_PATH

Second, in "mercurial.ini" add:

[extensions]
hggit=HGGIT_PATH\hggit

[ui]
ssh = "C:\Program Files\TortoiseHg\TortoisePlink.exe"

Third, for read-only access to a github repo:

hg clone git://github.com/USER/PROJECT.git LOCAL_PATH

Read-write access

For proper pushing, the "bookmarks" extension needs to be enabled in "mercurial.ini":

[extensions]
bookmarks=

Second, run

copy "C:\Program Files\TortoiseHg\TortoisePlink.exe" "C:\Program Files\TortoiseHg\ssh.exe"`

and also make a related change in "mercurial.ini":

[ui]
ssh = "C:\Program Files\TortoiseHg\ssh.exe"

Proper public+private key pair must be created, with the public key uploaded to github (see the links below).

PuTTY tool "pageant" must be started, with the private key loaded.

I needed to re-clone the repository, with:

hg clone git+ssh://git@github.com/USER/PROJECT.git LOCAL_PATH_2

(I pulled the commits from LOCAL_PATH into this new repo)

Although the bookmarks extension is "automatic", for me it required manual tweaking on each push, especially when there were branches in the repo; I had to move the bookmark-tags to be positioned on most recent changesets on proper heads.

References

@maphew

This comment has been minimized.

Copy link

commented Sep 23, 2016

Since version 1.8 the bookmark command is part of core, https://www.mercurial-scm.org/wiki/BookmarksExtension and https://www.mercurial-scm.org/wiki/Bookmarks. I think this means we no longer need to add it to the Extensions section of .ini (?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.