Gitのインストール
以下のサイトを参照してGitをインストールしました。
https://prog-8.com/docs/git-env-win
Dockerのインストール
以下のサイトを参照しました。
https://sukkiri.jp/technologies/virtualizers/docker/docker-win_install.html
Docker-composeのインストール
ssh鍵の生成
Git Bashを立ち上げ、以下のコマンド入力し、ssh鍵を生成しました。
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
- -t:鍵のタイプを指定。
- -b:鍵の長さを指定。短いとセキュリティ的に危険。
- -C:鍵のコメントを追加できる。
鍵の権限を変更します。
$ chmod 600 ~/.ssh/id_rsa
$ vim ~/.ssh/config
Host github
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_github
以上の設定により、ssh githubと入力しただけで、指定したホスト名・ユーザ名・秘密鍵が自動で指定される。
Githubへのssh接続
$ ssh github
以下のように出れば接続はOKです。
Hi ~~~~! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
参照サイトと異なる作業をした点のみ記載
ブランチを切る前にコミットをしなければなりませんでした。
$ git commit --allow-empty -m "xxx"
CentOSで作成していた本番用環境のプッシュ
CentOSにgitをインストール
# yum install git
リモートリポジトリに現段階の環境をプッシュ
以下のサイトを参考にしました。
https://kitsune.blog/git-command