Integrating BitBucket and GIT with ssh (no password required for push)

 

I’ve just gone through the process of integrating GIT with BitBucket so that when I sync I do not have to type in my username or password.  There are a couple locations I used as resources listed here. Much of what I did is exactly the same process but since it was a little of each I thought I’d blog it.

https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git

http://stackoverflow.com/questions/11918285/my-bashrc-file-not-executed-on-git-bash-startup-windows-7

My environment is VMWare Fusion running on a MacBook. I’m using the released version of Windows 8-64.

1) Install Git

2) Run from the launch icon Git Bash

3) verify ssh installed (ssh –v)

4) in the bash shell prompt, run ssh-keygen (do put in a passphrase)

5)  copy and paste the text from the file /Users/peter/.ssh/id_rsa.pub to the ssh section of your account information on bitbucket

6) paste the following code in to your .bashrc file:  

7) go to your bitbucket account information and grab the name of the repository in ssh speak. For me it is:  git@bitbucket.org:pkellner99/win8storeagelessemail.git

8) for me, it went into settings in tortoisegit and added the remote url in ssh speak, however I believe you can go into your /.git/config file and add to the remote origin section yourself the url of your remote repository (see below for what mine looks like.

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    hideDotFiles = dotGitOnly
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = git@bitbucket.org:pkellner99/win8storeagelessemail.git
[branch "master"]
    remote = origin
    merge = refs/heads/master
[gui]
    wmstate = normal
    geometry = 887×427+182+182 171 192

 

That’s it for now.  Hope this helps (it will me when I forget how to do this and have to come back to these notes)

About Peter Kellner

Peter is a software professional specializing in mobile and web technologies. He has also been a Microsoft MVP for the past 7 years. To read more about Peter Kellner and his experience click here. For information about how Peter Kellner might be able to help you with your project click here.

Follow me:


Comments

  1. Worked almost perfectly.

    I had to do another step though, importing the id_rsa private key into puttygen and then save it as a putty private key. That new key can then be used in TurtoiseGit when cloning a GIT repo.

    Also, it wasn’t clear to me that the .bashrc file had to be in the user profile folder (not for example .shh or .git).

Follow

Get every new post delivered to your Inbox

Join other followers: