railsでアプリケーションを作って、Githubでコードを管理する

1. まずはアプリケーションを作る

今回はデスクトップ配下に作ることに。

$ cd Desktop
$ rails new MyApp

移動する。

$ cd MyApp

2. Github上でリポジトリを作る

手順は簡単。 Reporitories上に行き、New をクリック。

f:id:kgmx:20140414075313p:plain

リポジトリ名ははさきほど作ったアプリケーションと同じMyAppにする。

f:id:kgmx:20140414075313p:plain

言われるがままにやってみる。

f:id:kgmx:20140414075239p:plain

$ touch README.md
$ git init
$ git add README.md
$ git commit -m "first commit"
$ git remote add origin git@github.com:kgmx/MyApp.git
$ git push -u origin master

作ったアプリケーション自体もコミットしてプッシュしておく。

$ git add .
$ git status
$ git commit -m "rails new MyApp"
$ git push origin master