clone AWS codecommit repo via HTTP

12,832

Solution 1

I actually found that I was able to connect, and previously I was failing because not following some steps quite hide in the AWS Codecommit docs:

I am not sure if giving the following at prompt are necessary steps, but I guess they do not hurt:

At terminal provide the following:

aws configure

you will be prompt to provide:

AWS Access Key ID

AWS Secret Access Key

Default region name

Default output format

Till here I do recommend to provide the above

After on clone "your https AWS address" your_repo_name, you are prompted to provide an username and a password. Unfortunately for both my root account and my IAM account(with correct rules policy) I got 403 error.

What was successful, without provide additional credential was to execute at terminal the following:

git config --global credential.helper '!aws codecommit credential-helper $@'
git config --global credential.UseHttpPath true 

then simply:

clone https://your_url_code your_repo_name for HTTPS connection from AWS Codecommit console

For more detailed instruction refer to the official docs

This worked for me.

Solution 2

Carmine!

I'm really sorry to hear that you have connection issues with CodeCommit.

You can try to setup a SSH connection following this docs: https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-ssh-unixes.html.

After that, open the repository with Gitkraken. When you try to pull or push, Gitkrake will ask you for credentials. Use the ssh credentials created on the previous step.

If Gitkraken fails again, check the file .git/config inside your local copy of the repository. I've noticed that the url created was incorrect, so check that the generated url matches the following pattern:

[remote "origin"]
url = ssh://<Your-SSH-Key-ID>@git-codecommit.<region>.amazonaws.com/v1/repos/<repo-name>
fetch = +refs/heads/*:refs/remotes/origin/*
Share:
12,832
Carmine Tambascia
Author by

Carmine Tambascia

I been done some coding since high school with "TurboPascal" simply to solve some geometrical problems. That time was only school stuff. I ended up to hold a bachelor degree in medical engineering. Apart from a wide range of engineering discipline( Analogical Electronics, Discrete Electronic, Telecommunications, Mechanic, Biomechanic, Algebra, Mathematical Analysis and many more, typical in a Bachelor in Italian faculty System much theory), mostly it was Information Technology topic related. My thesis was a validation of a cellular model build with Matlab and Simulink. The model was build based on a Hidden Markovian System. Basically was what today you would call @Machine learning model validation. At University time I was introduced to programming OO paradigm with Java. I just hated it, as I did not had enough time to deep into it and in Software development Principles. Now I start to reconsider that specifically for Big data and Android development, but for the moment doing simply writing code. Meantime I leaned SQL, Python and now in love with Javascript, fascinated by asynchronous programming(I studied model system and those were abstraction of synchronous and asynchronous Systems ), so seems some of my engineering studies did help here. My git repositories : https://github.com/TCarmine This represent only my works outside job, and is limited since 1 years. A visual view of it https://sourcerer.io/tcarmine My Portfolio: https://blog.allaroundjavascript.com/

Updated on June 12, 2022

Comments

  • Carmine Tambascia
    Carmine Tambascia almost 2 years

    I have set 2 repositories in AWS Codecommit and using before SourceTree from Windows, setting up access via HTTP protocol was and everything was working fine.

    Right not I am migrating the development of a project on a machine where I do have installed ubuntu and where I choose to use gitkraken.

    I was able to git clone in a folder where my user has read and write access(my user) via Terminal, so isn't permission related in Ubuntu, where after git clone "aws repo url" I was prompt asking for the username for the IAM and password(the one created at AWS IAM console).

    I can of course open that repo folder from gitkraken and see even all the remote branch and all the history, but once I do for example pull from gitkraken it failed as "access" denied. I cannot also clone the same or another repo from Gitkraken. So seems I do have to configure my credentials in gitkraken but not sure where that should be done. This official doc does not say much.

  • Carmine Tambascia
    Carmine Tambascia almost 6 years
    I will try with ssh, I was thinking so. Right now I am up and set with my IDE
  • Carmine Tambascia
    Carmine Tambascia over 5 years
    @EgidioCaprino I asked via HTTP protocol