GITHUTを使うための環境設定

PUBLICキーを作成する
$ ssh-keygen -t rsa -C "yourmail@gmail.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa): ~/.ssh/id_rsa_github
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa_github.
Your public key has been saved in id_rsa_github.pub.
The key fingerprint is:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx yourmail@gmail.com
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|                 |
|         . .     |
|    .   S . .    |
|  = .o     .     |
| = +E.+ . .      |
|+ +o.=.. +       |
|.+o+o.+.o        |
+-----------------+
GitHubにログイン
Account Settings -> SSH Public Keys -> Add another public key
cat id_rsa_github.pub # 中身を貼り付けて登録(パスワード再入力)
編集sshファイル、ホスト名と証明書ファイルをカスタマイズ
$ vim .ssh/config
Host github
HostName github.com
User git
Port 22
identityfile ~/.ssh/id_rsa_github
権限設定
$ chmod 600 .ssh/config
お試し接続
$ ssh github
The authenticity of host 'github.com (207.97.227.239)' can't be established.
RSA key fingerprint is xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.
PTY allocation request failed on channel 0
Hi User! You've successfully authenticated, but GitHub does not provide shell access.
                                                                                      Connection to github.com closed.
GITのユーザとメールを設定
$ git config --global user.name "Your Name"
$ git config --global user.email "yourmail@gmail.com"
$ git config --global color.ui true
GITHUBのWEBでリポジトリを作成後、下記の操作を行う
(名前をtest-repoと仮定する)
$ mkdir test-repo
$ cd test-repo
$ git init
$ touch README.md
$ git add README.md
$ git commit -m "first commit"
$ git remote add origin git@github:YourID/test-repo.git
$ git push -u origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 208 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@github:YourID/test-repo.git
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.
以上で、READMEファイルがCOMMITされましたので、
環境構築完了。