Every repository with this icon (
Every repository with this icon (
HowToContribute
Contributors are welcome! OneBody is what it is because of people like you meeting the needs of their own community. If there’s something you’d like to see OneBody do (or do better), or you want an annoying bug fixed, and can make it happen, then go for it! In short, do the work that you need done.
Below is a fairly good resource for getting you started.
Install Git
Git is an open source, distributed version control system. We use Git and GitHub to collaborate on the development of OneBody.
- Install Git on Mac (with MacPorts):
sudo port install git(and setup your ssh key) - Install Git on Linux:
sudo aptitude install git-core(and setup your ssh key) - Install Git on Windows: instructions here and screencast here
Install Prerequisites
See Prerequisites.
First Time Setup
First, you need to set up Git to know who you are and set a few other settings as well:
git config --global user.email you@example.com
git config --global user.name "John Doe"
git config --global apply.whitespace nowarn
Grab the Code
Fork OneBody on GitHub. Then:
git clone git@github.com:yourusername/onebody.git
cd onebody
git remote add official git://github.com/seven1m/onebody.git
Setup the Database
Choose your database…
SQLite (easiest)
rake db:migrate
rake onebody:load_sample_data
MySQL (harder)
You’ll need to install MySQL (easy as sudo aptitude install mysql-server on Ubuntu). Then:
$ mysql -uroot
mysql> create database onebody_dev;
mysql> create database onebody_test;
mysql> grant all on onebody_dev.* to onebody@localhost identified by onebody;
mysql> grant all on onebody_test.* to onebody@localhost identified by onebody;
mysql> exit
Bye
Now edit config/database.yml to look like this:
---
development:
adapter: mysql
database: onebody_dev
host: localhost
username: onebody
password: onebody
test:
adapter: mysql
database: onebody_test
host: localhost
username: onebody
password: onebody
Now, migrate and load the sample data:
rake db:migrate
rake onebody:load_sample_data
Start the Development Server
ruby script/server
Now, browse to http://localhost:3000
Add [Your Awesome Feature] or Fix [Bug You Found]
If you’re new to Ruby and Rails, check out the Rails documentation page.
Commit and Push Your Changes
After you add your killer feature or kill that featured bug, you’ll need to “commit” your changes and “push” them up to GitHub:
git add files/you/added # if any
git ci -a -v # now write a descriptive note at the top and save
git push
Now, do a “pull request” on GitHub to let us know about all your hard work.
For more help with git commands, you can watch this screencast and read all kinds of documentation at the git-scm site.
When you see the official repo is ahead of your fork, you have two main ways of getting the commits into your own repo:
# merge while keeping intact changes you've made that aren't in the official repo:
git pull --rebase official master
# ...or, you can completely reset your repo...
# *warning*, this command will overwrite any changes you've made
# that didn't get rolled into the official repo (config files should be safe)
git fetch official && git reset --hard official/master
Now, make your forked copy on GitHub up-to-date:
git push






