2
3

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 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:

- [Generating a new SSH key and adding it to the ssh\-agent \- User Documentation](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/)
- [gitHubでssh接続する手順~公開鍵・秘密鍵の生成から~ \- Qiita](http://qiita.com/shizuma/items/2b2f873a0034839e47ce)

## 設定
```bash: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


## 補完
- [Macでgitを利用した開発する際にやっておきたい準備 \- Qiita](http://qiita.com/NorsteinBekkler/items/a0622ee6a39d08d61b72)
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?