Using git in bitbucket without password

Submitted by alexmoreno on Sun, 02/10/2013 - 13:53

Look mom, without hands...

First, change this in your .git/config:

old url:

 url = https://USER@bitbucket.org/hispamedios/PROJECT.git

new one:

url = ssh://USER.bitbucket.org/hispamedios/PROJECT.git

 

Edit your .ssh/config, in your local directory, and add this:

 cat .ssh/config
Host YOURUSER.bitbucket.org 
HostName bitbucket.org 
User git
IdentityFile ~/.ssh/bitbucket

The last line is important, so you are indicating your identity file. Now create this file:

ssh-keygen -f .ssh/bitbucket -C "YOURUSER"

And now test it. Go to your local repository, do smart changes in your code and commit them or simply do a "git pull". It should not ask you for password anymore.

categorias