サーチ…


備考

awsコマンドラインツールgitコマンドを使ってローカル開発マシンをセットアップすることで準備をしてください。

gitコマンドラインのためのCodecommitの設定

AWS Codecommitは、プライベートGITリポジトリのストレージとして使用できます。設定には、有効なAWSアカウントが既にあると仮定して、いくつかのステップがあります。

  1. AWS Codecommitにサインアップしてください 。現在、 us-east-1地域のみが利用可能です。
  2. リポジトリにアクセスするIAMユーザを作成します(例: codecommit-user
  3. 権限ロールAWSCodeCommitFullAccessをこのユーザーにAWSCodeCommitFullAccessます。
  4. このユーザーの新しいAccess Keyを作成し、 key idsecret code
  5. 次に、ローカルマシンにAWS Configurationプロファイルを作成してください
$ aws configure --profile codecommit-user

次のステップでは、次のコマンドを使用して、 awsコマンドをgitに信任ヘルパーとして関連付けます。

$ git config --global credential.helper \
    '!aws --profile codecommit-user codecommit credential-helper $@'
$ git config --global credential.UseHttpPath true

後でこの設定を確認または編集することができます。

$ git config --global --edit

セクションに注意する必要があります:

[credential]
    helper = !aws --profile codecommit-user codecommit credential-helper $@
    UseHttpPath = true

これで通常どおりgitをコマンドラインから使用できます。

AWSコードキャストでSourceTreeを使用する

Atlassian SourceTreeは、MacおよびWindowsがソースコードリポジトリを管理するためのビジュアルツールです。これは、リモートリポジトリとしてCodecommitで使用できますが、codecommitと接続できるように、SourceTreeのローカルリポジトリに追加の設定オプションを追加する必要があります。

まず、ローカルgitのためにCodecommitを設定します。

あなたがcodecommitにプッシュしたいローカルのgitリポジトリを持っていると仮定すると、以下のステップに従ってください:

  1. Webコンソールを使用してAWS Codecommitにログインします。
  2. 新しいリポジトリを作成します( my-project
  3. HTTPS URLをコピーしますhttps://git-codecommit.us-east-1.amazonaws.com/v1/repos/my-projectようになりhttps://git-codecommit.us-east-1.amazonaws.com/v1/repos/my-project
  4. 今すぐSourceTreeでPanel Settings / Remoteを開きます
  5. 名前の付いた新しいリモートを追加: originおよびUrl / Path:前にコピーしたリンク
  6. 最後に、[Edit Config File]オプションを開き、次のスニペットを追加します。
[credential]
    helper = /usr/local/bin/aws --profile codecommit-user codecommit credential-helper $@
    UseHttpPath = true

ここに画像の説明を入力

設定ファイルを保存した後は、次のようになります。

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

注:これはOS-Xの設定に基づいています。 aws(この場合は/usr/local/bin/aws )のパスを特に注意してください。他のUnixやWindowsの設定では確かに違いがあります。



Modified text is an extract of the original Stack Overflow Documentation
ライセンスを受けた CC BY-SA 3.0
所属していない Stack Overflow