8
2

More than 5 years have passed since last update.

AWS CodeCommit からCloneができない

Last updated at Posted at 2018-03-11

環境

  • macOs High Sierra v10.13.2
  • Git v2.15.1
  • aws-cli v1.11.34
  • Python v2.7.13
  • Darwin v17.3.0
  • botocore v1.4.91

問題

CodeStarで作成したCodeCommitのRepositoryをローカルにターミナルからクローンしようとしたら、

Cloning into 'project_name'...
git: 'credential-aws' is not a git command. See 'git --help'.
Username for ...

と表示され、オフシャル手順通りにクローンできなかった。

経緯

CodeStarの「プロジェクトを作成」をしていく際に、

コードの編集方法の選択

という項目で、「コマンドラインツール」を選択し、右下の「手順を表示」ボタンを押下し以下を表示

スクリーンショット 2018-03-11 21.29.53.png

手順書通りに行ったがクローンを

Cloning into 'attendance'...
git: 'credential-aws' is not a git command. See 'git --help'.
Username for ...

が表示されうまくクローンできない。

対応

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

手順書にある上記を行なったときに、

git config --global credential.helper "aws --version codecommit credential-helper $@"

と表示されたので、vi ~/.gitconfigで設定を確認

[credential]
helper = "aws --version codecommit credential-helper "
UseHttpPath = true

となっていたため、以下に書き換え

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

その後、クローンしたところうまくいった。

AWS側の手順書は以下
Setup Steps for HTTPS Connections to AWS CodeCommit Repositories on Linux, macOS, or Unix with the AWS CLI Credential Helper

まとめ

コマンド自体に詳しくないため、はっきりとは原因がわからなかったが、
設定ファイルを直接書き換えることにより、対応はできた。
もし、詳しい方がいれば、ご教示願いたい。

8
2
1

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