0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ローカル開発環境の構築

Posted at

Gitのインストール

以下のサイトを参照してGitをインストールしました。
https://prog-8.com/docs/git-env-win

Dockerのインストール

以下のサイトを参照しました。
https://sukkiri.jp/technologies/virtualizers/docker/docker-win_install.html

Docker-composeのインストール

ssh鍵の生成

以下のサイトを参照しました。
https://eh-career.com/engineerhub/entry/2017/01/31/110000#%E7%92%B0%E5%A2%83%E3%81%AE%E6%A7%8B%E7%AF%892-SSH%E3%81%AE%E9%8D%B5%E3%82%92%E5%8F%96%E5%BE%97%E3%81%99%E3%82%8B

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

ローカルにリモートリポジトリの環境をクローン

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?