running git clone against AWS CodeCommits gets me a 403 error









up vote
3
down vote

favorite
2












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-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.



  1. 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


  2. 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.


  3. 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?










share|improve this question



























    up vote
    3
    down vote

    favorite
    2












    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-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.



    1. 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


    2. 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.


    3. 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?










    share|improve this question

























      up vote
      3
      down vote

      favorite
      2









      up vote
      3
      down vote

      favorite
      2






      2





      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-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.



      1. 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


      2. 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.


      3. 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?










      share|improve this question















      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-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.



      1. 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


      2. 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.


      3. 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?







      git amazon-web-services aws-codecommit






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 31 '15 at 13:00

























      asked Dec 29 '15 at 19:13









      Vietnhi Phuvan

      1,2881723




      1,2881723






















          6 Answers
          6






          active

          oldest

          votes

















          up vote
          3
          down vote













          For me the root cause of getting the error was that no matter which version of git I was using on OSX, GIT was always picking up the credential.helper config of using osxkeychain from the file:



          /Applications/Xcode.app/Contents/Developer/usr/share/git-core/gitconfig


          Getting rid of this solved the problem for me and has not broken anything.






          share|improve this answer




















          • This worked for me
            – Rob
            Mar 20 '17 at 12:22










          • Thank you! In my case, the first clone and commit worked for some reason - but then no go.
            – Kvisle
            Jan 5 at 19:09

















          up vote
          2
          down vote













          This helpful text is found on the AWS documentation for codecommit and Windows integration




          If your installation of Git for Windows included the Git Credential
          Manager utility, you will see 403 errors or prompts to provide
          credentials into the Credential Manager utility after the first few
          connection attempts. The most reliable way to solve this problem is to
          uninstall and then reinstall Git for Windows without the option for
          the Git Credential Manager utility, as it is not compatible with AWS
          CodeCommit.



          If you want to keep the Git Credential Manager utility,
          you must perform additional configuration steps to also use AWS
          CodeCommit, including manually modifying the .gitconfig file to
          specify the use of the credential helper for AWS CodeCommit when
          connecting to AWS CodeCommit.



          Remove any stored credentials from the
          Credential Manager utility (you can find this utility in Control
          Panel).



          Once you have removed any stored credentials, add the
          following to your .gitconfig file, save it, and then try connecting
          again from a new command prompt window:




          [credential "https://git-codecommit.us-east-1.amazonaws.com"]
          helper = !aws codecommit credential-helper $@
          UseHttpPath = true



          Additionally, you might have to re-configure your git config settings by specifying --system instead of --global or
          --local before all connections work as expected.




          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.



          git config --list --show-origin


          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



          "git: 'credential-aws' is not a git command. See 'git --help'."





          share|improve this answer
















          • 1




            This is was the most useful answer(at least to me). The mistake i did was to install git with credential manager utility. To work around this, you uninstall git, then install it and un check the credential manger utility. After that it worked like a charm. Thanks.
            – Maina Wycliffe
            Apr 3 '17 at 14:16

















          up vote
          2
          down vote













          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).



          enter image description here



          Click on edit link, update credential with proper git credential generated for AWS User, everything worked fine.






          share|improve this answer




















          • Vote this one, is the fix for windows 10
            – SilentTremor
            Aug 1 at 14:37

















          up vote
          1
          down vote













          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.






          share|improve this answer






















          • no need to add an aws profile (--profile bruce666) just !aws codecommit credential-helper $@ will do. +1
            – jmcg
            May 7 at 6:00


















          up vote
          1
          down vote













          My case in OSX.



          The first step:



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


          However, verifying git config --list --show-origin



          file:/usr/local/etc/gitconfig credential.https://git-codecommit.eu-west-1.amazonaws.com.helper=!aws codecommit credential-helper $@
          file:/usr/local/etc/gitconfig credential.helper=osxkeychain
          file:/Users/mine/.gitconfig user.name=my-user
          file:/Users/mine/.gitconfig user.email=my@gmail.com
          file:/Users/mine/.gitconfig filter.lfs.clean=git-lfs clean -- %f
          file:/Users/mine/.gitconfig filter.lfs.smudge=git-lfs smudge -- %f
          file:/Users/mine/.gitconfig filter.lfs.process=git-lfs filter-process
          file:/Users/mine/.gitconfig filter.lfs.required=true
          file:/Users/mine/.gitconfig credential.helper=!aws codecommit credential-helper $@
          file:/Users/mine/.gitconfig credential.usehttppath=true


          The first line was not present before, and git was using osxkeychain with precedence. Hence, I had to do git config --system ...



          cat /usr/local/etc/gitconfig 
          [credential "https://git-codecommit.eu-west-1.amazonaws.com"]
          helper = !aws codecommit credential-helper $@
          UseHttpPath = true
          [credential]
          helper = osxkeychain


          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]






          share|improve this answer





























            up vote
            1
            down vote













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



            1. Open Keychain Access

            2. Search for CodeCommit. You should find this:

            enter image description here



            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.






            share|improve this answer




















              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f34517534%2frunning-git-clone-against-aws-codecommits-gets-me-a-403-error%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              6 Answers
              6






              active

              oldest

              votes








              6 Answers
              6






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              3
              down vote













              For me the root cause of getting the error was that no matter which version of git I was using on OSX, GIT was always picking up the credential.helper config of using osxkeychain from the file:



              /Applications/Xcode.app/Contents/Developer/usr/share/git-core/gitconfig


              Getting rid of this solved the problem for me and has not broken anything.






              share|improve this answer




















              • This worked for me
                – Rob
                Mar 20 '17 at 12:22










              • Thank you! In my case, the first clone and commit worked for some reason - but then no go.
                – Kvisle
                Jan 5 at 19:09














              up vote
              3
              down vote













              For me the root cause of getting the error was that no matter which version of git I was using on OSX, GIT was always picking up the credential.helper config of using osxkeychain from the file:



              /Applications/Xcode.app/Contents/Developer/usr/share/git-core/gitconfig


              Getting rid of this solved the problem for me and has not broken anything.






              share|improve this answer




















              • This worked for me
                – Rob
                Mar 20 '17 at 12:22










              • Thank you! In my case, the first clone and commit worked for some reason - but then no go.
                – Kvisle
                Jan 5 at 19:09












              up vote
              3
              down vote










              up vote
              3
              down vote









              For me the root cause of getting the error was that no matter which version of git I was using on OSX, GIT was always picking up the credential.helper config of using osxkeychain from the file:



              /Applications/Xcode.app/Contents/Developer/usr/share/git-core/gitconfig


              Getting rid of this solved the problem for me and has not broken anything.






              share|improve this answer












              For me the root cause of getting the error was that no matter which version of git I was using on OSX, GIT was always picking up the credential.helper config of using osxkeychain from the file:



              /Applications/Xcode.app/Contents/Developer/usr/share/git-core/gitconfig


              Getting rid of this solved the problem for me and has not broken anything.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Mar 2 '17 at 12:36









              Juha Kervinen

              593




              593











              • This worked for me
                – Rob
                Mar 20 '17 at 12:22










              • Thank you! In my case, the first clone and commit worked for some reason - but then no go.
                – Kvisle
                Jan 5 at 19:09
















              • This worked for me
                – Rob
                Mar 20 '17 at 12:22










              • Thank you! In my case, the first clone and commit worked for some reason - but then no go.
                – Kvisle
                Jan 5 at 19:09















              This worked for me
              – Rob
              Mar 20 '17 at 12:22




              This worked for me
              – Rob
              Mar 20 '17 at 12:22












              Thank you! In my case, the first clone and commit worked for some reason - but then no go.
              – Kvisle
              Jan 5 at 19:09




              Thank you! In my case, the first clone and commit worked for some reason - but then no go.
              – Kvisle
              Jan 5 at 19:09












              up vote
              2
              down vote













              This helpful text is found on the AWS documentation for codecommit and Windows integration




              If your installation of Git for Windows included the Git Credential
              Manager utility, you will see 403 errors or prompts to provide
              credentials into the Credential Manager utility after the first few
              connection attempts. The most reliable way to solve this problem is to
              uninstall and then reinstall Git for Windows without the option for
              the Git Credential Manager utility, as it is not compatible with AWS
              CodeCommit.



              If you want to keep the Git Credential Manager utility,
              you must perform additional configuration steps to also use AWS
              CodeCommit, including manually modifying the .gitconfig file to
              specify the use of the credential helper for AWS CodeCommit when
              connecting to AWS CodeCommit.



              Remove any stored credentials from the
              Credential Manager utility (you can find this utility in Control
              Panel).



              Once you have removed any stored credentials, add the
              following to your .gitconfig file, save it, and then try connecting
              again from a new command prompt window:




              [credential "https://git-codecommit.us-east-1.amazonaws.com"]
              helper = !aws codecommit credential-helper $@
              UseHttpPath = true



              Additionally, you might have to re-configure your git config settings by specifying --system instead of --global or
              --local before all connections work as expected.




              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.



              git config --list --show-origin


              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



              "git: 'credential-aws' is not a git command. See 'git --help'."





              share|improve this answer
















              • 1




                This is was the most useful answer(at least to me). The mistake i did was to install git with credential manager utility. To work around this, you uninstall git, then install it and un check the credential manger utility. After that it worked like a charm. Thanks.
                – Maina Wycliffe
                Apr 3 '17 at 14:16














              up vote
              2
              down vote













              This helpful text is found on the AWS documentation for codecommit and Windows integration




              If your installation of Git for Windows included the Git Credential
              Manager utility, you will see 403 errors or prompts to provide
              credentials into the Credential Manager utility after the first few
              connection attempts. The most reliable way to solve this problem is to
              uninstall and then reinstall Git for Windows without the option for
              the Git Credential Manager utility, as it is not compatible with AWS
              CodeCommit.



              If you want to keep the Git Credential Manager utility,
              you must perform additional configuration steps to also use AWS
              CodeCommit, including manually modifying the .gitconfig file to
              specify the use of the credential helper for AWS CodeCommit when
              connecting to AWS CodeCommit.



              Remove any stored credentials from the
              Credential Manager utility (you can find this utility in Control
              Panel).



              Once you have removed any stored credentials, add the
              following to your .gitconfig file, save it, and then try connecting
              again from a new command prompt window:




              [credential "https://git-codecommit.us-east-1.amazonaws.com"]
              helper = !aws codecommit credential-helper $@
              UseHttpPath = true



              Additionally, you might have to re-configure your git config settings by specifying --system instead of --global or
              --local before all connections work as expected.




              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.



              git config --list --show-origin


              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



              "git: 'credential-aws' is not a git command. See 'git --help'."





              share|improve this answer
















              • 1




                This is was the most useful answer(at least to me). The mistake i did was to install git with credential manager utility. To work around this, you uninstall git, then install it and un check the credential manger utility. After that it worked like a charm. Thanks.
                – Maina Wycliffe
                Apr 3 '17 at 14:16












              up vote
              2
              down vote










              up vote
              2
              down vote









              This helpful text is found on the AWS documentation for codecommit and Windows integration




              If your installation of Git for Windows included the Git Credential
              Manager utility, you will see 403 errors or prompts to provide
              credentials into the Credential Manager utility after the first few
              connection attempts. The most reliable way to solve this problem is to
              uninstall and then reinstall Git for Windows without the option for
              the Git Credential Manager utility, as it is not compatible with AWS
              CodeCommit.



              If you want to keep the Git Credential Manager utility,
              you must perform additional configuration steps to also use AWS
              CodeCommit, including manually modifying the .gitconfig file to
              specify the use of the credential helper for AWS CodeCommit when
              connecting to AWS CodeCommit.



              Remove any stored credentials from the
              Credential Manager utility (you can find this utility in Control
              Panel).



              Once you have removed any stored credentials, add the
              following to your .gitconfig file, save it, and then try connecting
              again from a new command prompt window:




              [credential "https://git-codecommit.us-east-1.amazonaws.com"]
              helper = !aws codecommit credential-helper $@
              UseHttpPath = true



              Additionally, you might have to re-configure your git config settings by specifying --system instead of --global or
              --local before all connections work as expected.




              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.



              git config --list --show-origin


              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



              "git: 'credential-aws' is not a git command. See 'git --help'."





              share|improve this answer












              This helpful text is found on the AWS documentation for codecommit and Windows integration




              If your installation of Git for Windows included the Git Credential
              Manager utility, you will see 403 errors or prompts to provide
              credentials into the Credential Manager utility after the first few
              connection attempts. The most reliable way to solve this problem is to
              uninstall and then reinstall Git for Windows without the option for
              the Git Credential Manager utility, as it is not compatible with AWS
              CodeCommit.



              If you want to keep the Git Credential Manager utility,
              you must perform additional configuration steps to also use AWS
              CodeCommit, including manually modifying the .gitconfig file to
              specify the use of the credential helper for AWS CodeCommit when
              connecting to AWS CodeCommit.



              Remove any stored credentials from the
              Credential Manager utility (you can find this utility in Control
              Panel).



              Once you have removed any stored credentials, add the
              following to your .gitconfig file, save it, and then try connecting
              again from a new command prompt window:




              [credential "https://git-codecommit.us-east-1.amazonaws.com"]
              helper = !aws codecommit credential-helper $@
              UseHttpPath = true



              Additionally, you might have to re-configure your git config settings by specifying --system instead of --global or
              --local before all connections work as expected.




              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.



              git config --list --show-origin


              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



              "git: 'credential-aws' is not a git command. See 'git --help'."






              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Jul 27 '16 at 16:20









              joezen777

              13612




              13612







              • 1




                This is was the most useful answer(at least to me). The mistake i did was to install git with credential manager utility. To work around this, you uninstall git, then install it and un check the credential manger utility. After that it worked like a charm. Thanks.
                – Maina Wycliffe
                Apr 3 '17 at 14:16












              • 1




                This is was the most useful answer(at least to me). The mistake i did was to install git with credential manager utility. To work around this, you uninstall git, then install it and un check the credential manger utility. After that it worked like a charm. Thanks.
                – Maina Wycliffe
                Apr 3 '17 at 14:16







              1




              1




              This is was the most useful answer(at least to me). The mistake i did was to install git with credential manager utility. To work around this, you uninstall git, then install it and un check the credential manger utility. After that it worked like a charm. Thanks.
              – Maina Wycliffe
              Apr 3 '17 at 14:16




              This is was the most useful answer(at least to me). The mistake i did was to install git with credential manager utility. To work around this, you uninstall git, then install it and un check the credential manger utility. After that it worked like a charm. Thanks.
              – Maina Wycliffe
              Apr 3 '17 at 14:16










              up vote
              2
              down vote













              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).



              enter image description here



              Click on edit link, update credential with proper git credential generated for AWS User, everything worked fine.






              share|improve this answer




















              • Vote this one, is the fix for windows 10
                – SilentTremor
                Aug 1 at 14:37














              up vote
              2
              down vote













              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).



              enter image description here



              Click on edit link, update credential with proper git credential generated for AWS User, everything worked fine.






              share|improve this answer




















              • Vote this one, is the fix for windows 10
                – SilentTremor
                Aug 1 at 14:37












              up vote
              2
              down vote










              up vote
              2
              down vote









              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).



              enter image description here



              Click on edit link, update credential with proper git credential generated for AWS User, everything worked fine.






              share|improve this answer












              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).



              enter image description here



              Click on edit link, update credential with proper git credential generated for AWS User, everything worked fine.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Mar 24 '17 at 22:49









              irfanmcsd

              4,56862750




              4,56862750











              • Vote this one, is the fix for windows 10
                – SilentTremor
                Aug 1 at 14:37
















              • Vote this one, is the fix for windows 10
                – SilentTremor
                Aug 1 at 14:37















              Vote this one, is the fix for windows 10
              – SilentTremor
              Aug 1 at 14:37




              Vote this one, is the fix for windows 10
              – SilentTremor
              Aug 1 at 14:37










              up vote
              1
              down vote













              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.






              share|improve this answer






















              • no need to add an aws profile (--profile bruce666) just !aws codecommit credential-helper $@ will do. +1
                – jmcg
                May 7 at 6:00















              up vote
              1
              down vote













              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.






              share|improve this answer






















              • no need to add an aws profile (--profile bruce666) just !aws codecommit credential-helper $@ will do. +1
                – jmcg
                May 7 at 6:00













              up vote
              1
              down vote










              up vote
              1
              down vote









              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.






              share|improve this answer














              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.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Dec 30 '15 at 13:06

























              answered Dec 30 '15 at 12:48









              Vietnhi Phuvan

              1,2881723




              1,2881723











              • no need to add an aws profile (--profile bruce666) just !aws codecommit credential-helper $@ will do. +1
                – jmcg
                May 7 at 6:00

















              • no need to add an aws profile (--profile bruce666) just !aws codecommit credential-helper $@ will do. +1
                – jmcg
                May 7 at 6:00
















              no need to add an aws profile (--profile bruce666) just !aws codecommit credential-helper $@ will do. +1
              – jmcg
              May 7 at 6:00





              no need to add an aws profile (--profile bruce666) just !aws codecommit credential-helper $@ will do. +1
              – jmcg
              May 7 at 6:00











              up vote
              1
              down vote













              My case in OSX.



              The first step:



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


              However, verifying git config --list --show-origin



              file:/usr/local/etc/gitconfig credential.https://git-codecommit.eu-west-1.amazonaws.com.helper=!aws codecommit credential-helper $@
              file:/usr/local/etc/gitconfig credential.helper=osxkeychain
              file:/Users/mine/.gitconfig user.name=my-user
              file:/Users/mine/.gitconfig user.email=my@gmail.com
              file:/Users/mine/.gitconfig filter.lfs.clean=git-lfs clean -- %f
              file:/Users/mine/.gitconfig filter.lfs.smudge=git-lfs smudge -- %f
              file:/Users/mine/.gitconfig filter.lfs.process=git-lfs filter-process
              file:/Users/mine/.gitconfig filter.lfs.required=true
              file:/Users/mine/.gitconfig credential.helper=!aws codecommit credential-helper $@
              file:/Users/mine/.gitconfig credential.usehttppath=true


              The first line was not present before, and git was using osxkeychain with precedence. Hence, I had to do git config --system ...



              cat /usr/local/etc/gitconfig 
              [credential "https://git-codecommit.eu-west-1.amazonaws.com"]
              helper = !aws codecommit credential-helper $@
              UseHttpPath = true
              [credential]
              helper = osxkeychain


              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]






              share|improve this answer


























                up vote
                1
                down vote













                My case in OSX.



                The first step:



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


                However, verifying git config --list --show-origin



                file:/usr/local/etc/gitconfig credential.https://git-codecommit.eu-west-1.amazonaws.com.helper=!aws codecommit credential-helper $@
                file:/usr/local/etc/gitconfig credential.helper=osxkeychain
                file:/Users/mine/.gitconfig user.name=my-user
                file:/Users/mine/.gitconfig user.email=my@gmail.com
                file:/Users/mine/.gitconfig filter.lfs.clean=git-lfs clean -- %f
                file:/Users/mine/.gitconfig filter.lfs.smudge=git-lfs smudge -- %f
                file:/Users/mine/.gitconfig filter.lfs.process=git-lfs filter-process
                file:/Users/mine/.gitconfig filter.lfs.required=true
                file:/Users/mine/.gitconfig credential.helper=!aws codecommit credential-helper $@
                file:/Users/mine/.gitconfig credential.usehttppath=true


                The first line was not present before, and git was using osxkeychain with precedence. Hence, I had to do git config --system ...



                cat /usr/local/etc/gitconfig 
                [credential "https://git-codecommit.eu-west-1.amazonaws.com"]
                helper = !aws codecommit credential-helper $@
                UseHttpPath = true
                [credential]
                helper = osxkeychain


                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]






                share|improve this answer
























                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  My case in OSX.



                  The first step:



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


                  However, verifying git config --list --show-origin



                  file:/usr/local/etc/gitconfig credential.https://git-codecommit.eu-west-1.amazonaws.com.helper=!aws codecommit credential-helper $@
                  file:/usr/local/etc/gitconfig credential.helper=osxkeychain
                  file:/Users/mine/.gitconfig user.name=my-user
                  file:/Users/mine/.gitconfig user.email=my@gmail.com
                  file:/Users/mine/.gitconfig filter.lfs.clean=git-lfs clean -- %f
                  file:/Users/mine/.gitconfig filter.lfs.smudge=git-lfs smudge -- %f
                  file:/Users/mine/.gitconfig filter.lfs.process=git-lfs filter-process
                  file:/Users/mine/.gitconfig filter.lfs.required=true
                  file:/Users/mine/.gitconfig credential.helper=!aws codecommit credential-helper $@
                  file:/Users/mine/.gitconfig credential.usehttppath=true


                  The first line was not present before, and git was using osxkeychain with precedence. Hence, I had to do git config --system ...



                  cat /usr/local/etc/gitconfig 
                  [credential "https://git-codecommit.eu-west-1.amazonaws.com"]
                  helper = !aws codecommit credential-helper $@
                  UseHttpPath = true
                  [credential]
                  helper = osxkeychain


                  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]






                  share|improve this answer














                  My case in OSX.



                  The first step:



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


                  However, verifying git config --list --show-origin



                  file:/usr/local/etc/gitconfig credential.https://git-codecommit.eu-west-1.amazonaws.com.helper=!aws codecommit credential-helper $@
                  file:/usr/local/etc/gitconfig credential.helper=osxkeychain
                  file:/Users/mine/.gitconfig user.name=my-user
                  file:/Users/mine/.gitconfig user.email=my@gmail.com
                  file:/Users/mine/.gitconfig filter.lfs.clean=git-lfs clean -- %f
                  file:/Users/mine/.gitconfig filter.lfs.smudge=git-lfs smudge -- %f
                  file:/Users/mine/.gitconfig filter.lfs.process=git-lfs filter-process
                  file:/Users/mine/.gitconfig filter.lfs.required=true
                  file:/Users/mine/.gitconfig credential.helper=!aws codecommit credential-helper $@
                  file:/Users/mine/.gitconfig credential.usehttppath=true


                  The first line was not present before, and git was using osxkeychain with precedence. Hence, I had to do git config --system ...



                  cat /usr/local/etc/gitconfig 
                  [credential "https://git-codecommit.eu-west-1.amazonaws.com"]
                  helper = !aws codecommit credential-helper $@
                  UseHttpPath = true
                  [credential]
                  helper = osxkeychain


                  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]







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jul 2 at 8:20

























                  answered Jun 27 at 10:16









                  ericson.cepeda

                  1,3071012




                  1,3071012




















                      up vote
                      1
                      down vote













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



                      1. Open Keychain Access

                      2. Search for CodeCommit. You should find this:

                      enter image description here



                      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.






                      share|improve this answer
























                        up vote
                        1
                        down vote













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



                        1. Open Keychain Access

                        2. Search for CodeCommit. You should find this:

                        enter image description here



                        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.






                        share|improve this answer






















                          up vote
                          1
                          down vote










                          up vote
                          1
                          down vote









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



                          1. Open Keychain Access

                          2. Search for CodeCommit. You should find this:

                          enter image description here



                          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.






                          share|improve this answer












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



                          1. Open Keychain Access

                          2. Search for CodeCommit. You should find this:

                          enter image description here



                          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.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Nov 11 at 5:46









                          user846316

                          2,19131731




                          2,19131731



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f34517534%2frunning-git-clone-against-aws-codecommits-gets-me-a-403-error%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              這個網誌中的熱門文章

                              Barbados

                              How to read a connectionString WITH PROVIDER in .NET Core?

                              Node.js Script on GitHub Pages or Amazon S3