aws-cli Use SourceTree with AWS Codecommit


Atlassian SourceTree is a visual tool for Mac and Windows to manage source code repositories. This can be used with Codecommit as a remote repository but need to add an extra configuration option to the local repository in SourceTree to be able to connect with codecommit.

First, setup Codecommit for local git.

Assuming you have a local git repository which you want to push to codecommit just follow these steps:

  1. Login to AWS Codecommit using the web console.
  2. Create a new repository, eg my-project
  3. Copy the HTTPS URL, it should look like
  4. Now in SourceTree open the panel Settings / Remotes
  5. Add new remote with name: origin and Url / Path: the link you copied before
  6. Finally open the option Edit Config File and add the following snippet:
    helper = /usr/local/bin/aws --profile codecommit-user codecommit credential-helper $@
    UseHttpPath = true

enter image description here

After saving the config file should look something like this:

    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    precomposeunicode = true
[branch "master"]
    remote = origin
    merge = refs/heads/master
[remote "origin"]
    url =
    fetch = +refs/heads/*:refs/remotes/origin/*
    helper = /usr/local/bin/aws --profile codecommit-user codecommit credential-helper $@
    UseHttpPath = true

Please note: this is based on OS-X setup. Take special care of the path for aws (which is /usr/local/bin/aws in this case) and will most certainly be different under other Unixes or Windows configurations.