March 10, 2011

Set Default Remote Repository for Mercurial Push and Pull

I wanted to use a remote bitbucket repository for pushing changesets to an already locally created Mercurial repository. Normally we can use $ hg push https://mrhaki@bitbucket.org/mrhaki/com.mrhaki.sample-app. But if we want to use $ hg push without the repository URL we must add the URL to the file $REPO/.hg/hgrc. We add the following contents:

default = https://mrhaki@bitbucket.org/mrhaki/com.mrhaki.sample-app