Setting up Sourcetree for Windows and Beanstalk

By 2nd May 2013Development

At LogicSpot, we’re very proud users of many of Atlassian’s tools – JIRA, Confluence, Issue Collector, Crucible and FishEye.  They work superbly for us and we’ve written in previous blog posts how happy we are to extol their virtues.

Atlassian released SourceTree for Mac in October 2010.  After a short period of “Please release for Windows” requests on their feedback sites, with quite a lot of “+1s” they’ve released SourceTree for Windows, and it’s brilliant.

SourceTree supports Atlassian’s own BitBucket straight out of the box, as you would expect. We all want to use SourceTree as a way of standardising source code control across all staff – some are currently using command line, some use Git Extensions, Mac users are using SourceTree … which makes it difficult for training newcomers!

We don’t currently use BitBucket, but use our own hosted GIT repos and Beanstalk.  And it’s not the simplest to setup SSH keys and integrate with Beanstalk .. so I figured it would be good to share a how-to guide to integrate SourceTree for Windows and Beanstalk together!

If there’s any steps wrong below, or you feel the guide can be extended, be sure to leave feedback and we’ll incorporate it below.  Happy coding!

Steps

Prerequisites: You have downloaded the latest Sourcetree version, and you already have a Beanstalk account and at least one repository.

Download Sourcetree from Atlassian.

Run Sourcetree if you’ve not done so before.  The current release at time of writing this hasn’t generated license keys for any of us, so follow instructions to generate one manually if it doesn’t work.

Generating public and private keys for GIT

1. In SourceTree, choose Tools / Create or Import SSH Keys from the menu.

Generating public and private keys for Git
2. Click “Generate” and wiggle the mouse as requested on screen

Key generator
3. Enter and confirm a key passphrase (this will be used each time you want to commit, etc)

Key passphrase
4. Click “Save private key” and save it to your User folder (mine was UserData .ssh) and save with filename of sourcetree.ppk
5. Click “Save public key” and save it to the same folder, so save it again as sourcetree as it doesn’t have an extension
6. Very important – Select the entire public key that’s been generated in the text box at the top and copy it to the clipboard!

Copy public key
7. Close the “Generate” dialog box altogether.

Add the Private Key to Sourcetree

1. Go to your Windows System Tray.  Whenever you have Sourcetree running there will be an app running called “Pageant” which is the PuTTY authentication agent – it’s a blue PC with a hat icon – yeah, kinda catchy hey.  Open this app up.
2. Click “Add Key”
3. Browse to the private key file (mine was UserData .ssh) folder. And choose the .ppk file and “Open” it
4. Type in your passphrase from step 3 above.
5. Close this dialog box.
6. Go to Tools / Options
7. Stay on the General tab. Click the “…” button next to the SSH Key

SSH Key
8. Browse to the folder as step 3, and choose the .ppk file again.
9. Still on General tab, click “…” next to the project folder, and choose your base folder – in my case it is D:\Wamp\WWW\
10. Click “OK” to close the options dialog box.

Add the Public Key to Beanstalk

1. Login to your Beanstalk instance
2. Click “Profile & Settings” top right and login again if required
3. Click on “Keys” tab at the top
4. Click “Add Public Key” button

Add Public Key
6. Go back to Beanstalk where you left it, and paste in the clipboard contents to the “SSH Key” field

SSH Key details
7. Add a label if you wish – mine is “mark-pc”
8. Click the “Save” button at the bottom
9. You should now see the new “mark-pc” key in the list of SSH Public Keys, hurrah!

Add a repo

1. Go to the repo you want in Beanstalk.
2. Top right of the repo page is the “Your GIT Repository URL” – choose SSH here

Git repository URL
3. Copy the URL to the clipboard.
4. Go back to SourceTree
5. Click “Clone/New” from the icon toolbar.
6. Stay on the first opening tab (Clone Repository) and paste the URL copied from above.

Clone Repository
7. Click away from the text field – some checks will be done and you should see a message saying “Accept server’s key” – click “Yes” here.
8. You should now see “Checking repository source” and a spinner. You should then get back “This is a GIT repository”
9. Destination path – change as required. Mine was correct straight away.
10. Bookmark – leave that ticked, so you can easily go back to it later.
11. Specify any “Name” that is appropriate.
12. Click “Clone” button at the bottom
13. The repo will now be cloned from Beanstalk down to your destination folder on your PC.

  • laike9m

    nice article!

  • Tim

    Very clear and helpful – thank you!

  • Mike

    This was very helpful for me – You were very concise and that was greatly appreciated – thanks.

  • Annie

    Detailed and Explanatory.Thanks for the article!

  • http://www.webdevschizzle.com Damian

    Really clear and concise article. Thanks a lot for this!

  • http://www.wordimpress.com/ Devin Walker

    Man, what a helpful and clear tutorial. Thanks a bunch!

    • https://www.logicspot.com Mark Haller

      Wicked, thanks for the kind words Devin – glad it helped 🙂

  • Chris Schulz

    Very helpful, many thanks 🙂