使用 SourceTree 連上 CodeCommit HTTPS 還算簡單,官網和Google一堆文章
直接使用 CLI 連上 CodeCommit SSH 也還不難,官網和Google 同樣一堆文章
但要今天唯獨在 SourceTree + CodeCommit + SSH 的方式,找了好多方法
照著官網的教學做可以完成90%,只要你的帳號權限有設定正確,從 Console 底下各種操作都不會有問題(Permission denied...)
所以我直接講結論
想要將 AWS CodeCommit 整合進 SourceTree使用,又不想特別在 AWS IAM 去產生一組 Password的話
你必須在 ~/.ssh/config 裡面的設定必需要額外加上下面這一行
HostName <full_complete_git_url>
如果我的 Repos 路徑是
ssh://git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/myReposName
修改完成的 Config 內容如下:
...
Host git-codecommit.*.amazonaws.com
HostName git-codecommit.ap-northeast-1.amazonaws.com
User <YOUR_SSH_KEY_ID>
IdentityFile ~/.ssh/id_rsa
...
參考:
[1] 在 Linux, macOS, or Unix 上對 AWS CodeCommit 儲存庫建立 SSH 連線的設定步驟