Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

Dev Cheatsheet

sunnyuny edited this page Oct 17, 2015 · 3 revisions

First time developing

git clone https://github.com/scalableinternetservices/Foodies.git
cd Foodies
bundle install
rake db:migrate
rake db:reset

Review pull request

You may receive an email about pending pull request. If so, click on the link to go to the pull request. If not, go to https://github.com/scalableinternetservices/Foodies/pulls and find the open pull requests.

  • Make sure all checks have passed. If not, the pull request is not ready for review.
  • Look at the diff online.
  • Checkout the actual code.
  git checkout some-feature-branch
  • Try to run the app and test it.
bundle install
rake db:migrate
rake db:reset
rails server
  • If you find anything wrong or unclear, please leave a comment.
  • If you find everything ok, please "+1" in the comment.

Develop a new feature

Please don't push directly to master branch. We should create feature branch and create pull request for code review before merging the feature branch into master branch. Please see Pull request tutorial for detailed instructions.

Common git commands

git branch
git log

reset local repository to the state of last commit

git reset --hard HEAD

remove local branch

git branch -D create-basic-mvc

Common rake commands

  • run the required migrations until it has reached the specified version
rake db:migrate VERSION=20080906120000
  • rollback the last migration
rake db:rollback
  • create the database, load the schema and initialize it with the seed data
rake db:setup
  • drop the database and set it up again. equivalent to rake db:drop db:setup
rake db:reset
  • runs the change method for all the migrations that have not yet been run
rake db:migrate