I imagine the problem is the url to your repo. It needs to be adjusted to use the alias created in your ~/.ssh/config
:
git remote set-url origin git@bitbucket:path/to/repo.git
Additionally, you could make your ~/.ssh/config
look like this:
ServerAliveInterval 15
ServerAliveCountMax 3
Host bitbucket
HostName bitbucket.org
User git
IdentityFile ~/.ssh/bitbucket
Note the presence of the User
key. That will tell ssh that whenever you use the alias bitbucket
to also use the user name git
. The above command can then become:
git remote set-url origin bitbucket:path/to/repo.git
Additionally, whenever you clone, you can do:
git clone bitbucket:path/to/repo.git
To also save you a little typing.