Skip to content

Instantly share code, notes, and snippets.

@sgnl
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgnl/9983808 to your computer and use it in GitHub Desktop.
Save sgnl/9983808 to your computer and use it in GitHub Desktop.
Setting up SSH and .git/config to work with BitBucket
//On BitBucket
var user = 'sgnl' //enter your username here
if (!logged_in_at_bitbucket){
userLogin();
}
goTo.YourAccountSettings('https://bitbucket.org/account/' + user + '/');
$('a#SSH-Kets').click();
$('button#Add-key').click();
/*
* in your terminal get your SSH key
* pbcopy < ~/.ssh/is_rsa.pub // OSX
* //Ubuntu??????
* clip < ~/.ssh/id_rsa.pub //Windows
*/
$('.textrea .longfield').val(your-ssh-key);
$('button#add-key').click();
/*
Replace 'user' with your user name and update your path to your project accordingly.
Add bitbucket remote to your git with:
git remote add origin git@bitbucket.com:user/path/to/project.git
if you already set up your origin as https connection then you will
have to make a new reference or overwrite it with the above url.
Another way is to edit your .git/config file and add string from above
"git@bitbucket.com:user/path/to/project.git"
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment