running git clone against AWS CodeCommits gets me a 403 error

后端 未结 13 786
没有蜡笔的小新
没有蜡笔的小新 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

    I solved it.

    The 403 error message is a specifically Git error message. I added the two AWS-specified helper commands:

    git config --global credential.helper '!aws --profile bruce666 codecommit credential-helper $@'
    git config --global credentials.helper UseHttpPath=true
    

    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:

    [core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
        precomposeunicode = false
    [credential]
        helper = !aws --profile bruce666 codecommit credential-helper $@
        UseHttpPath = true
    [remote "origin"]
        url = https://git-codecommit.us-east-1.amazonaws.com/v1/repos/barthea
        fetch = +refs/heads/*:refs/remotes/origin/*
    [branch "master"]
        remote = origin
        merge = refs/heads/master
    

    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.

提交回复
热议问题