-
Notifications
You must be signed in to change notification settings - Fork 14
The Contributor's How to Guide
If you are on Windows open up the git bash, everyone else grab a terminal. Remember, commit early and often and always check your work before committing. Check everything again before pushing to github!
-
Check for changes upstream:
cd /path/to/Observatory git pull origin
-
Make sure you are on the right branch, you probably want the rcos branch:
git branch > * master > rcos > rcos_production git checkout rcos
-
Make whatever changes you want to any files you need to.
-
Git can tell you what branch you are on and what you have done at any time:
git status
-
Test out your changes using
manage.py:cd Observatory/observatory python manage.py runserver #Check it out in your browser @ localhost:8000
-
Decide if the changes belong on
masterorrcos:master is for generic changes to the system rcos is for rcos specific information and changes If you don't know what rcos-production is for, don't commit to it
-
Checkout the right branch, add your changes, and commit:
git checkout rcos git add path/to/file1 path/to/file2 path/to/file3 git status #Review what you are committing git commit -m "Your message here. Be descriptive"
-
Check everything again, if you push something broken, its hard to fix
-
Push your changes up to github:
git push
-
Check github for your changes!
http://github.com/NateStedman/Observatory/commits/<branchname>
-
Repeat as necessary
Github has a pretty nice and simple help page for this if you view the pull
request and click the Merge Help button.
In general there are 3 steps
-
Add a new remote location for their repository:
git remote add bamnet-observatory https://github.com/bamnet/Observatory.git
-
Grab and review their changes on a new branch:
git checkout -b bamnet rocs git pull bamnet-observatory rcos cd observatory python manage.py runserver
-
If everything checks out, merge the changes and push:
git checkout rcos git pull bamnet-observatory rcos git pull #check for changes in origin git push #push the new commits
All the tasks here could probably be wrapped into shell scripts
-
Log onto the server (if you have access):
ssh <user>@rcos.cs.rpi.edu > Password: **********
-
Grab the deployment permissions:
sudo su www-data > Password: **********
-
Grab the changes from github:
cd /var/www/Observatory/ git fetch origin
-
Make sure you are on rcos-production:
git branch > ... > rcos > * rcos-production > ...
-
Merge the fetched changes into production:
git merge origin/rcos
-
Restart Apache (only required if Python files changed, but do it anyways):
sudo /etc/init.d/apache2 restart
-
Make sure that everything worked:
http://rcos.cs.rpi.edu
-
Make sure you are in the repo with deployment permissions:
sudo su www-data cd /var/www/Observatory
-
Revert the changes to before the merge:
git checkout HEAD^
-
Call for help!!