running git clone against AWS CodeCommits gets me a 403 error

后端 未结 13 722
没有蜡笔的小新
没有蜡笔的小新 2021-01-31 14:56

My local laptop is a Mac.

  1. The ssh key is configured properly. This is the content of ~/.ssh/config

    Host barthea Hostname git-codecommit.us-east

相关标签:
13条回答
  • 2021-01-31 15:36

    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:

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

    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.

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

    Best of luck.

    Referred: https://forums.aws.amazon.com/thread.jspa?threadID=198356 Posted by: mwhardesty

    0 讨论(0)
  • 2021-01-31 15:37

    Whenever it asks to enter Username and Password while trying to clone or pull the code from AWS, instead of copying the password manually enter it by typing each letter. This resolved my problem.

    0 讨论(0)
  • 2021-01-31 15:39

    In my case, I had a permission issue.

    You need to need to attach the AWSCodeCommitFullAccess policy to your IAM user to give you access to CodeCommit.

    0 讨论(0)
  • 2021-01-31 15:45

    Something was wrong with my default aws credentials, I ran aws configure again with no profile, restarted terminal and it worked.

    0 讨论(0)
  • 2021-01-31 15:48

    On MAC, if above-mentioned tricks don't work, do the following:

    1. Open Keychain Access
    2. Search for CodeCommit. You should find this:

    1. Select 'git-codecommit....' and press delete
    2. Confirm the delete.

    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.

    0 讨论(0)
  • 2021-01-31 15:48

    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.

    0 讨论(0)
提交回复
热议问题