LoginSignup
0
0

More than 1 year has passed since last update.

AWS SSO CodeCommit+SourceTreeを利用する方法

Last updated at Posted at 2022-09-14

はじめに

AWS SSOで管理している AWSアカウントのCodecommitからクローンしたり
クローンしてきたリポジトリをSourceTreeから操作できるようにする為の
備忘録的な記事です。

環境

  • MacOS
    • git
    • aws-cli

利用サービス

  • AWS

    • Codecommit
  • その他

    • SourceTree

前提

  • 対象AWSアカウントのCodecommitへ リポジトリが作成されている事
  • 対象AWSアカウントの認証情報がaws configureで設定されている事

手順

1. Git Configの設定書き換え

下記コマンドを実行し、Git認証情報ヘルパーがAWS認証情報プロファイルを使用するよう指定

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

2. gitconfig を編集

下記コマンドを実行し、.gitconfigを一部編集

$ git config --global --edit

.gitconfig から削除(又はコメントアウト)

# credential.helper=osxkeychain

.gitconfig へ追記

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

3. クローン

下記コマンドを実行し、クローンする
※ リポジトリURL(HTTPS)はCodecommitのより取得

git clone https://git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/xxxxxxx

4. SourceTreeで利用

[新規...] →[既存のリポジトリを追加]でクローンしてきたリポジトリを選択
※ ここまでの設定に問題なければ、fetch pull等を行えるはず

おわりに

誰かの助けになれば幸いです。

0
0
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
0
0