LoginSignup
2
3

More than 5 years have passed since last update.

GitとGitHubの環境設定

Last updated at Posted at 2017-01-14

git

鍵作成

terminal
$ cd
$ mkdir ~/.ssh && cd ~/.ssh
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
$ Generating public/private rsa key pair.
$ Enter file in which to save the key (/Users/(username)/.ssh/id_rsa):id_github_"your_name"_rsa
$ Enter passphrase (empty for no passphrase):
$ Enter same passphrase again:

設定

terminal
$ git config --global user.name "your_name"
$ git config --global user.email your_email@example.com

github

  • 公開鍵の確認
terminal
$ vi ~/.ssh/id_github_"your_name"_rsa.pub
$ 上記の中身をコピー
terminal
$ mkdir ~/.ssh/config
$ vi ~/.ssh/config
Host github github.com
  HostName github.com
  IdentityFile ~/.ssh/id_github_"your_name"_rsa
  User git
$ ssh -T github

補完

2
3
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
2
3