1 创建IAM用户
IAM创建admin用户,增加AWSCodeCommitFullAccess权限
![](https://file.jishuzhan.net/article/1795297692092469250/be72d21e6724b9cb19400057ed93ce01.webp)
2 创建存储库
CodePipeline -> CodeCommit -> 存储库
![](https://file.jishuzhan.net/article/1795297692092469250/0523cb042756bcfed80aaff1c1b644e9.webp)
创建存储库
![](https://file.jishuzhan.net/article/1795297692092469250/fff9906485fff8ce2298e89ede533df9.webp)
3 SSH
- window环境
3.1.1 上载SSH公有秘钥
![](https://file.jishuzhan.net/article/1795297692092469250/bc3290606acf7b06861461df883e8df7.webp)
![](https://file.jishuzhan.net/article/1795297692092469250/484f2b62309784a9d90d4eff34e28e23.webp)
生成SSH秘钥ID
![](https://file.jishuzhan.net/article/1795297692092469250/6b5639731699a71da577c9640aad9d65.webp)
3.1.2 编辑本地 ~/.ssh 目录中名为"config"的 SSH 配置文件
bash
Host git-codecommit.us-east-x.amazonaws.com
User 上一步的秘钥ID
IdentityFile ~/.ssh/Your-Private-Key-File-Name-Here
4 git拉取代码
bash
$ git clone ssh://git-codecommit.us-east-x.amazonaws.com/v1/repos/aws-codepipeline-demo
5 提交代码
bash
$ git add -A
$ git commit -m "Add sample application files"
$ git push
![](https://file.jishuzhan.net/article/1795297692092469250/3a6d6b604c54f81589f63e81f7c07e64.webp)