githubをはじめるまで

gitからgithubをはじめるまでの備忘録。

※git, github, gravatarの連携は登録したメールアドレスが同じことで連携するので、3つのサービスで使用するメールアドレスを揃える必要がある。


git環境作成

  • [local] gitのインストール
  • [local] gitのユーザープロファイル変更
$ git config --global user.email hoge@foo.com


github環境作成

$ ssh-keygen
$ cat id_rsa.pub | pbcopy
  • [web] githubへ公開鍵登録


リポジトリ登録


ソースコード登録

$ cd sample/
$ git init
$ git add <file>
$ git commit -m 'first commit'
$ git remote add origin git@github.com:hogehoge/sample.git
$ git push origin master


(別マシンなどで)ソースコード取得・更新

  • [local]
$ git clone git://github.com/foobar/sample.git
$ git push origin master


日々の作業
githubから最新の取得
$ git pull