Using git in bitbucket without password

Look mom, without hands...

First, change this in your .git/config:

old url:

 url = https://[email protected]/hispamedios/PROJECT.git

new one:

url = ssh://


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

 cat .ssh/config
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.


private git repositories in bitbucket

Let me got directly to the point. The bitbucket documentation is wrong, on the begining you are just suposed to do a git remote add origin

in the directory which you want to commit. But this will not work:

fatal: Not a git repository (or any of the parent directories): .git

Solution? Init the repository:

git init

git remote add origin https://[email protected]/ACCOUNT/REPOSITORY.git

git push -u origin master

will also don´t work :-(. The problem is that the message error is all but obvious.


error: src refspec master does not match any.

error: failed to push some refs to 'https://[email protected]/ACCOUNT/REPOSITORY.git'


But, think... we need to have something to commit before sending this "thing", don't we?


git add .

git commit -m "first commit with all the contents

And, finally, we send the commits with the changes in our code:

git push -u origin master


remote: bb/acl: hispamedios is allowed. accepted payload.

To ....


Nice, isn't it?