ローカルからgithubのレポジトリをつくる

ローカルですでに存在するプログラムをそのまま git に押し込む方法
git でレポを作ってから、

$ git init
$ git add *
$ git commit -m "first commit"
$ git remote add origin https://github.com/ ユーザ名 / レポ名 .git

で、これだけで push すると当然エラーが出るわけですね。

Ken Fujiyoshi@klee_arc ~/fab
$ git push origin master
Username for 'https://github.com':
Password for 'https://klee-arc@github.com':
To https://github.com/klee-arc/fabmodules.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/klee-arc/fabmodules.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.

当然向こうはすでに initialize されてるし、こっちもコードあって initialize されているわけだし、衝突するんで、

$ git pull
$ git merge origin/master
$ git commit -m "merged"
$ git push

でいけた。

ウェブから確認しておわり。