-
Notifications
You must be signed in to change notification settings - Fork 27
Developer Workflow
Akila Ravihansa Perera edited this page Feb 27, 2014
·
21 revisions
All Sahana Vesuvius source code is managed by git
, and hosted on GitHub
under Sahana organizational account. Not only is GitHub
used to host the source code, but also to facilitate collaboration via forks
and pull requests
. Sahana Vesuvius contributors are expected to follow the GitHub flow
.
If you've not used GitHub before:
- Sign-up for an account on GitHub
- Set up git on you your computer by following these instructions.
- Note: In order to contribute code back to the Eden project, you need to "push" your changes to GitHub, and GitHub requires you to authenticate for that. The instructions describe authenticating using a password. If you don't want to do do that, you can use SSH keys instead. For more information, see links below.
- For Windows users
- For Linux users
- Generating SSH keys
Get your own copy of the Vesuvius repository on both GitHub and your local machine:
- Fork the Eden repository at: https://github.com/sahana/vesuvius
- Use git to clone your own new fork down to your PC, as follows:
cd /var/www
git clone [email protected]:<mygitusername>/vesuvius
cd vesuvius
git remote add upstream git://github.com/sahana/vesuvius
https://docs.google.com/drawings/d/1T2k_1fPxCLTqQ-xjZc7MS48Bk8o9rUrSkkvaQmzMGCM/edit
** Summary of coding workflow using Git **
cd /var/www/vesuvius
# Update your local repository with latest code from the trunk repository on GitHub
git pull --rebase upstream
# Write Code
# Quick review of code (no test code left in, etc)
git diff
# Check for any new files which need adding
git status
git add .
# Commit Code (Note, no pushes to GitHub here)
git commit -am "My Changes: Part 1"
.
.
.
git commit -am "My Changes: Part N"
# Pull in changes from trunk
git pull --rebase upstream
# Resolve any conflicts (see below for how)
# Commit fixed code
git add .
git commit -a
# Review commits
git log
# Squash commits
# Use rebase to squash commits to as few as possible to keep revision history clean & make it easier to review the work
# http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html
git rebase -i HEAD~N # Where N = Number of commits to squash
# Push to your branch on GitHub
git push
- Once you have pushed to your branch on GitHub, you will likely want this to be merged with Trunk - this should be done via a Pull Request. This is done at GitHub
- For more details, visit here.