My local laptop is a Mac.
The ssh key is configured properly. This is the content of ~/.ssh/config
Host barthea Hostname git-codecommit.us-east-1.amazonaws.com User AVVVVVVVVVVVVVVVVVQ IdentityFile ~/.ssh/aws-aws.pem
Running ssh barthea gets me
`You have successfully authenticated over SSH. You can use Git to interact with AWS CodeCommit. Interactive shells are not supported.Connection to git-codecommit.us-east-1.amazonaws.com closed by remote host.
` 2. I created an IAM user bruce666 complete with password and access keys, made this user part of the "team" group.Then I created a policy that includes "AWSCodeCommitPowerUsers" and assigned this policy to "team". And finally assigned bruce666 to "team". At this point, bruce666 can access any repo in CodeCommit through the management console.
I ran aws config --profile bruce666, fed in his access and secret key, his region and specified the format at json. At this point, I was able to create the rekha repo in CodeCommmit by running aws codecommit get-repository --repository-name rekha --profile bruce666
I can create a couple of dummy files, run git init, git add . , git commit -m "1", git add origin https://git-gitcode.amzonaws.com/repos/v1/rekha , git push -u origin master And that operation will be successful.
However, when I run git clone ssh://git-gitcode.amazonaws.com/repos/v1/rekha , I get "fatal: unable to access 'https://git-codecommit.us-east-1.amazonaws.com/v1/repos/barthia/': The requested URL returned error: 403" What gives?
My case in OSX.
The first step:
However, verifying
git config --list --show-origin
The first line was not present before, and git was using
osxkeychain
with precedence. Hence, I had to dogit config --system ...
So the URL was specified in order to fallback in case another credentials are stored.
Update https://docs.aws.amazon.com/codecommit/latest/userguide/troubleshooting-ch.html
For some reason, UseHttpPath = true seems not to be added sometimes. So it can (should) be added under [credential]
On MAC, if above-mentioned tricks don't work, do the following:
Now try again. It should work. You may have to do it again next time as well when you face the error 403.
One of the possible reason for this issue is the keychain password different than login password on your MAC.
This helpful text is found on the AWS documentation for codecommit and Windows integration
This last part applied to my situation, though when I ran git config --system it did not function as expected but appended aws configure before the aws codecommit command.
So I had to run this in git to find the location of the config file for the system.
I then added the suggested section from AWS to both my c:/users/username/.gitconfig and my c:/ProgramData/Git/config files.
After that git push started working- even though I get the bogus error in front of my response of
The following solution worked for a handful of devs that use Git Bash on Windows 10.
If you select Windows as your operating system on the "Connect to your repository" tab, the commands are formatted like this:
However, if you use Git Bash, select the "Linux, MacOS, or Unix" option instead. Note the single quote instead of double quote on the first line.
Best of luck.
Referred: https://forums.aws.amazon.com/thread.jspa?threadID=198356 Posted by: mwhardesty
I solved it.
The 403 error message is a specifically Git error message. I added the two AWS-specified helper commands:
and that took care of the issue.
The .git/config file in your local directory (before you clone the Codecommit repo that you had just created should look like this:
As specified in the .git/config file, you are cloning using https not ssh. I must not have used the default version of git that came with OSX because I did not run into any Toolchain issue.
I also face same 403 error while using git push command in windows. I done all settings mentioned in AWS docs, but non resolved my issue. After i reviewed git credential set via Windows Credential as shown in screen. I found instead of git https credentials, it set access key / secret key (don't know how).
Click on edit link, update credential with proper git credential generated for AWS User, everything worked fine.