背景・目的
AWS Cloud9を試してみたで作成したCloud9環境に、CodeCommit環境を構築する。
内容
事前準備
リポジトリを事前に作成する。

Gitのバージョンを確認する
- CodeCommit は Git バージョン 1.7.9 以降をサポートしている。
$ sudo yum -y update
$ git --version
git version 2.32.0
$
Git Configで環境を設定する
$ git config --global user.name "XXXXX"
$ git config --global user.email "XXXX@XXXX"
$ git config --global core.editor 'vim -c "set fenc=utf-8"'
$ git config --global color.diff auto
$ git config --global color.status auto
$ git config --global color.branch auto
CodeCommitを操作する
作成したリポジトリをCloneする
$ git clone https://git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/jupyter-repo
Cloning into 'jupyter-repo'...
warning: You appear to have cloned an empty repository.
$ ls -l
drwxrwxr-x 3 ec2-user ec2-user 18 Mar 26 13:42 jupyter-repo
$
ファイルを作成しPushする
$ pwd
/home/ec2-user/jupyter-repo
$ ls -l
total 4
-rw-rw-r-- 1 ec2-user ec2-user 15 Mar 26 13:50 README.md
$ cat README.md
# first commit
$ git add .
$ git commit -a
$ git push origin master
リポジトリを確認する
- ファイルが追加された。

参考