AWS CodeCommit - 基础用法
AWS CodeCommit 是完全托管的源代码控制服务,可托管安全的 Git 存储库,相当于一个Private GitHub。它可让团队在安全且高度可扩展的生态系统中轻松协作处理代码。使用 CodeCommit,无需运行自己的源代码控制系统,也无需担心基础设施的扩展能力。可以使用 CodeCommit 将来自源代码的任何数据安全存储为二进制文件,而且它可以无缝兼容您现有的 Git 工具。
下面,我们一起探索一下CodeCommit的基本用法,来实现你的第一个Commit。
1. Create an AWS CodeCommit Repository
Create in the AWS Console:
Service Menu -> CodeCommit -> Create repository
On the Create repository page, configure:
- Name: My-Repo
- Description: My first repository
- Click Create
An empty repo called My-Repo will be created in CodeCommit. Connection details will be shown.
2. Create an EC2 Instance
Create an EC2 instance in the AWS Console, and record down the public IP address.
3. Connect the CodeCommit to the EC2 instance
通常有两种方式:
- SSH keys for AWS CodeCommit
- HTTPS Git credentials for AWS CodeCommit
这里,我们使用 SSH keys for AWS CodeCommit
Before this step, you need to create a Key pair for authentication. Say the name is “KEYPAIR.pem”.
Save the .pem file to your local computer.
- chmod