在AWS上配置CodeCommit

本文详细介绍了如何在AWS上配置CodeCommit。首先通过AWS Console创建Repository,然后在Windows环境下配置HTTPS连接,包括安装Git(不带Credential Manager),安装AWS CLI并设置访问密钥。接着,文章提供了克隆Repository的命令,并提到了遇到的Git Credential Manager问题,指导用户在IAM控制台生成相应的凭证以解决这个问题。

CodeCommit的配置相对简单,首先登陆到AWS Console界面,到CodeCommit出,点Create Repository,给个名字,即可完成Repository的创建。然后就是配置客户端连接,这个比较麻烦。

我选用的是HTTPS连接方式和Windows客户端,然后AWS给出连接步骤:


1. Install Git (1.7.9 or later supported) without the Git Credential Manager utility. If you don’t have Git installed, install it now.

https://git-scm.com/download/win

2. Install the AWS CLI.

http://docs.aws.amazon.com/cli/latest/userguide/awscli-install-windows.html#awscli-install-windows-path

    At the command line, type aws configure and configure the AWS CLI with your IAM user access key and secret key.
    Attach an appropriate AWS CodeCommit managed policy to the IAM user. Learn more

Steps to clone your repository

    At the command line, paste the following commands:

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

Clone your repository to your local computer and start working on code:

git clone https://git-codecommit.xxxxxx.amazonaws.com/v1/repos/xxxxxxxxxxx


对于AWS CLI key的配置

aws configure --profile my-test-profile(your profile name)

access key:

secret key:

region: us-east-1 or 2 or others

format: default - press Enter key


如此AWS CLI配完,然后是git:

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


后面输入:git clone https://git-codecommit.xxxxxx.amazonaws.com/v1/repos/xxxxxxxxxxx

提示需要输入Git Credential Manager的用户名和密码

搜索后看到:

If you intend to use HTTPS with the credential helper that is included in the AWS CLI instead of configuring Git credentials for AWS CodeCommit, on the Configuring extra options page, make sure the Enable Git Credential Manager option is cleared.
不知道这个在哪里取消,因此按照:http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html,生成对应的用户名和密码来解决。


In the IAM console, in the navigation pane, choose Users, and from the list of users, choose your IAM user.

On the user details page, choose the Security Credentials tab, and in HTTPS Git credentials for AWS CodeCommit, choose Generate.
Generating Git credentials in the IAM console


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值