


Helper = store -file /Users/jsmith/.git-credentials.awesome-microserviceĪt this point, you should be able to clone down your repo from CodeCommit without having to input a username/password.

Create/update your $HOME/.gitconfig file with a new credential section for your CodeCommit credentials: Now that you have your credential file, we need to tell the git binaries where to find the credential. Here’s what the HTTPS git credential string looks like: store this string in a file, I might name it something like: $HOME/.git-credentials.awesome-microservice Let’s say we are working with a repo called “awesome-microservice” in us-east-1. git-credentials file in your home directory for the repository(ies) you want access to via git commands. However, if I have different credentials (e.g., different personal access tokens in GitLab) for different repositories within the same top-level domain, problems arise.Īfter you’ve generated your CodeCommit credentials in the IAM console for your IAM user, you will need to configure a. git-credentials file for multiple repos at the same top level domain and it works when a single set of credentials is used for access to all the repositories. This is because the git-credential helper logic is sensitive to credential sorting by top-level domain. I have found that it helps to break out different repositories (CodeCommit, GitLab, GitHub, etc.) into separate. Git Push FailsPushing to BitBucket and received this response: remote: Invalid. Either solution also requires adding a section to your $HOME/.gitconfig file for the credential being used. With static git credentials, there is no need for AWS CLI integration. An alternative solution is to use IAM keys with CodeCommit, but it requires credential helper configuration with the AWS CLI in order to handle the dynamics of IAM session management. The solution I’m going to suggest works with using static CodeCommit credentials from the Credentials section of your AWS IAM user object. On the Repositories page, choose Create repository. For more information, see Regions and Git connection endpoints. I will be describing a solution that works for macOS and MSFT VisualStudio Code. Open the CodeCommit console at Use the region selector to choose the AWS Region where you want to create the repository. I’d like to share an approach that works for me when using HTTPS (instead of SSH keys) and hopefully it will be helpful for you, too. Working with AWS CodeCommit repositories in addition to other repositories from the same git configuration can be a challenge depending on your git configuration.
