Basic Managing of Mercurial Repos with Bitbucket

1. Setting ssh.

  • cd ~/.ssh
  • ssh-keygen. Enter a phrase when requested. Then enter the file path. /home/your_user_name/ssh/id_rsa. After this steps file will be created.
  • ssh-add ~/.ssh/id_rsa. This loads your default identity into ssh agent.
  • Go to your Bitbucket Account/Manage Accounts/SSH Keys and upload the content of
  • gvim ~/.hgrc and add the line: ssh = ssh -C. this allows ssh compression under mercurial.

You are all set with ssh configuration.
2. Setting a new mercurial repository.

  • Create a new repo in Bitbucket.
  • Change HTTPS to SSH and copy the link to clipboard on your local machine.
  • mkdir new_repo_name.
  • cd new_repo_name.
  • hg init
  • gvim \.hg/hgrc and ad two lines: [paths]\newline default-push = copied_link_from_Bitbucket. Note, by default \.hg/hgrc does not exist.
  • do some work, create some files
  • hg status. Look what changes you have made.
  • hg commit -m `Some commit message’.
  • hg push.

You are done 🙂

This entry was posted in Bash, Mercurial, Programming and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s