LoginSignup
3
6

More than 5 years have passed since last update.

Code Commitの使い方

Posted at

AWSのリポジトリサービス「Code Commit」の使い方。
Windows環境でのリポジトリ作成~Pushの手順。
APIアクセスキーを使用したHTTPSの通信が前提。

AWSCLIのインストール

AWSのサイトからCLIのインストーラーをダウンロードする。
https://s3.amazonaws.com/aws-cli/AWSCLI64.msi

ダウンロードしてきたインストーラーを起動しインストールする。

アクセスキーの登録

次のコマンドでアクセスキーを登録する。
4項目質問されるのでそれぞれ次のように入力する。

aws configure --profile codecommit
  AWS Access Key ID [None]: { アクセスキー }
  AWS Secret Access Key [None]: { シークレットキー }
  Default region name [None]: us-east-1
  Default output format [None]:

リポジトリ作成

Code Commitに登録したいリポジトリを作成。

git init

アクセスキーの設定

上記の手順で登録したアクセスキーをGitに設定する。
「--profile」の項目は上記で登録した内容に合わせること。

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

CodeCommitにpush先を設定

次のコマンドでCodeCommitのリポジトリをリモート先に設定する。

git remote add origin { Code CommitのURL }
git remote -v

CodeCommitにpush先

次のコマンドでCodeCommitにpushします。

push
git push -u origin master

3
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
6