cs445DoC/DoCSite — pull request #4 by bwatson2 (2014-04-25 02:52:06+00:00)
Title: Initialize app

This is a blank rails app. You can generate one at the command line using:

rails new your_app_name

I'm just going to merge this into our master, so that we have a good blank slate to start from. Next time you enter your directory to work on code for this project, make sure you follow these steps:

1) make sure you change to the master branch, using this command: git checkout master
2) checkout the latest version of "master." It is a good idea to update your version of master frequently, by typing the following in the terminal WHILE in your master branch: git pull
(this actually performs two actions. This sort of grabs the latest version of our master branch from git, and puts it within reach of your terminal. Then, it will update YOUR version of master with any changes that have occurred on the GIT version of master.)

This will make sure that any branch you make after pulling will contain all the latest changes from master. If someone merges another branch into master, you will have to git pull your local master branch AGAIN to see those changes.

Now, suppose you want to add fix a bug in our user model. Make a new branch like this: git branch fix_user_bug

You can change to that branch like this: git checkout fix_user_bug

Do some coding. Did you make important changes? Do you want to put those changes on git? If so...

MAKE SURE YOU ADD YOUR CHANGES:
i) git add path/to/file/you/changed.rb (this will "stage" a single file, meaning you want to keep the changes you made
ii) git add . (that is a space and a period after "add". This will add any and all of the changes you have made to files git already knows about. If you made a completely NEW file, or deleted files, you will have to use "git add filepath" to specify the new or deleted file.
iii) if you want to keep ERRTHING you have changed. EVERYTHING. You can use "git add --all". This will also capture any new or deleted files.

MAKE SURE YOU COMMIT YOUR ADDED(staged) CHANGES:
i) git commit -m "type a descriptive message here"
ii) if you just type "git commit", you will be taken to a text editor (probably vim) to compose your message

PUSH THOSE CHANGES TO GIT
i) git push origin BRANCH_NAME (if you have not set up our repo as a remote, you will have to change origin to the url of our repo, the same one you used to clone)

ASK FOR A PULL REQUEST
i) once your branch is on git, submit a pull request. Try not to merge your own branches into master, wait for someone to give you a go-ahead. We don't have a large team tho, so maybe we should come up with a system.

MERGING A PULL REQUEST
i) merging a pull request will squish all of the changes from one branch into the master branch. The master branch is the one we will run on heroku.
ii) failing tests, and code which causes failing tests, should never be pushed to the master branch. This could cause our site to crash.
iii) it's good to make comments about incorrect code, confusing code, potential bugs, questions, and optimizations. Pull requests are all about code review and team work!