Connecting SourceTree to AWS CodeCommit: HTTP error 403

I'm using SourceTree to work with git on Mac OS, and choose AWS CodeCommit as the remote hosting server.

Following these steps for HTTPs connection between AWS and my local repo,

I got errors like: 

Refer to this question for more about my problem.

Thanks for any advice!

4 answers

I just found this answer here (https://geekprotem.com/2015/07/10/aws-codecommit-with-sourcetree/)

After following the setup steps for AWS CLI on Amazon's website, the final step to get this to work was editing my repository's config file in SourceTree to include the following:

[credential]
helper = /usr/local/bin/aws codecommit credential-helper $@
UseHttpPath = true

Thanks. For Windows, I had to put `helper = "C:/Progra~1/Amazon/AWSCLI/aws.exe" codecommit credential-helper $@`. Hope it helps to anyone.

0 vote

I have not tested this, but given AWS CodeCommit facilitates a credential helper too and the error being`command not found`, I would assume you are affected by the same issue outlined in the SourceTree Knowledge Base article Credential helpers "git: 'credential-osxkeychain' is not a git command. See 'git --help'."

The error [...] occurs because Git calls this helper and cannot find it meaning it has been defined and yet not found on the PATH. In terms of SourceTree as of version 1.6.3 this is nothing to worry about. There's two ways to stop this from happening.

  1. Not recommended, but if you're solely using SourceTree for everything you could remove the 'credential' setting from the /usr/local/git/etc/gitconfig config. This is a quick and easy method, but it does mean operations at the terminal may not be able to authenticate.
  2. Recommended, create a symlink between git-credential-osxkeychain in the SourceTree app resources and your local git install.

    ln -s /usr/local/git/bin/git-credential-osxkeychain /Applications/SourceTree.app/Contents/Resources/git_local/bin/git-credential-osxkeychain

Of course, since AWS CodeCommit requires the credential helper to be in place, only solution 2 is conceptually applicable for your scenario and you need to adjust the link source and targets as appropriate for the CodeCommit credential helper.

0 vote

Though everything worked as expected in terminal and Github Desktop, for Sourcetree I had to create symlinks between the aws helper application (mine was in my Python directory but type "which aws" in terminal to find yours) and the git bin directory. If you are on a Mac and using the embedded git in Sourcetree, then add the aws symlink into 

/Applications/SourceTree.app/Contents/Resources/git_local/bin/

If you are using the system git, then it probably goes into

/usr/local/git/bin/
0 vote

I am using AWS with cloudways managed platform, Here's the link you can check their service with AWS and integration is very easy through their managed platform, https://www.cloudways.com/en/amazon-cloud-hosting.php

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

564 views 1 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you