githubの設定とか、その他

GitHub をやろうやろうと思って、やっとやり始めたら
git push が出来なかったので、設定の備忘録を残しておきます。



サーバ側でSSHの公開・秘密鍵を作成

# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:



~/.ssh/config に設定を記述

vi ~/.ssh/config

Host github.com
User git
Hostname github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa



GitHub のアカウントのページにてSSHの公開鍵を設定



SSHにてGitHubにアクセスを行う

# ssh git@github.com
Enter passphrase for key '/home/rightgo09/.ssh/github_id_rsa': GitHubのパスワード



.git/config を変更

vi mark-and-sweep/.git/config

url = ssh://git@github.com/hayabusa333/mark-and-sweep.git のように sshのgit@に変更する



以上で、git pushができるようになります。

GitHubは、下記のようなものを公開しています。まだほとんど書かれてはいませんけど、これから少しずつ書いていこうと思います。

https://github.com/hayabusa333/mark-and-sweep