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 id_rsa.pub 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 id_rsa.pub.
- 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 🙂