AWS CodeCommit with SourceTree

Hopefully this post will be quickly deprecated, but for now I wanted to get this down in case others have trouble like I did. I use SourceTree as my git client, and when testing the new AWS CodeCommit service, this is what I did to get things working.

So here I’ll show what I did to get SourceTree on OS X working with CodeCommit.

I’m assuming here that you’ve done the first 4 steps from this document, and the first step from this document.

I have multiple repositories, and I don’t want them all to use the credential helper, so I did things per-repository. I also have multiple AWS profiles, so I had to make one as show in the docs.

Gather the info you’ll need :
AWS Username and Password
CodeCommit HTTPS endpoint

Open up your repo in SourceTree, and then click on ‘Settings’. From there, select your remote path and edit it. Choose ‘unknown’ for the ‘Host Type’, and put in your CodeCommit HTTPS URL for the path. Click ‘OK’.

Now click on ‘Edit Config File’. ‘URL’ and ‘PushURL’ will need to be updated with the new CodeCommit HTTPS URL. And this will need to be pasted into the end :

helper = /usr/local/bin/aws --profile PROFILENAME codecommit credential-helper [email protected]
UseHttpPath = true

Where PROFILENAME is, well, the name of the AWS profile your created for this.

Now you can push/pull and you’ll be prompted for your AWS username and password, and it should work.

Really, there isn’t much I changed from the docs they publish, but I had to use the full path for the aws cli tools to get things to work.

AWS CodeCommit with SourceTree