rails 4.2.2

1/rails _4.2.2_ new hello_app

2/修改gemfile

3/bundle install

4/rails server -b $IP -p $PORT(cloud9)

5/添加hello,action

6/修改路由(config/routes.rb)

root 'application#hello'

Git版本控制

1/git init(当前目录创建仓库)

2/git add -A(当前目录下的文件添加到仓库)

3/git commit -m "Initialize reposity"(提交添加,并添加说明)

Bitbucket代码托管

1/复制(本地cat命令),添加公钥(网站添加)

2/create reposity(网站添加)

3/添加Bitbucket,将本地的代码添加到bitbucket网站

git remote add origin git@bitbucket.org:jackzones/hello_app.git

4/推送,将代码推送到Bitbucket网站

git push -u origin --all

git 使用分支

1/git co -b modify-readme(-b,新建branch)

2/git branch(查看分支)

3/修改readme文件

4/git status (查看分支状态,相对于上个分支的改动)

5/git commit -a -m "Improve the readme fils"(-a没有新加文件,提交现有文件的所有改动)

6/git co master(转到主分子)

7/git merge modify-readme(将次分支合并到主分支)

8/git branch -d modify-readme(可选,删除分支)

9/git push(推送到bitbucket)

heroku部署

1/下载heroku

2/heroku login(登录)

3/keroku keys:add(添加秘钥)

4/heroku create(创建 app)

5/git push heroku master