Git is used as the distributed version control system for the source code of the Project Assignment Website. This guide is based on the documentation at http://git-scm.com and has been tested on an system running Ubuntu 12.04. Before beginning, install git-core on your system. If you are unfimiliar with Git, a recommend starting point is http://git-scm.com/book/en/
If you are a registered gitolite user on mecheng, clone the Project Assignment Website repository as follows
$ git clone gitolite@mecheng:website_ProjectAssignment
If your user account is not registered, ask the mecheng.up.ac.za admin to register it. To do the registerstration the admin will need the public key of your Linux user account, on the machine you intend to edit the source code from. Such a key can be generated as follows
$ if [ ! -f $HOME/.ssh/id_rsa.pub ] ; then ssh-keygen -t rsa ; fi
To clone the Project Assignment Website code, users need to be registered on the gitolite ( http://sitaramc.github.com/gitolite/users.html ) server running on mecheng.up.ac.za. To register a user the mecheng admin needs to do the following. Copy the users public key to mecheng.up.ac.za using the gitolite naming convention described at http://sitaramc.github.com/gitolite/users.html , for example if the users email address was bob.smith@up.ac.za, then
$ scp ${USER_ID_PUB} adymond@mecheng:~/gitolite-admin/keydir/bob.smith@up.ac.za@${USERS_HOSTNAME}.pub
Log into mecheng.up.ac.za, and modify the gitolite config file; add the users id under the configuration for the website_projectAssignment repo, then push the changes.
$ cd ~/gitolite-admin/
$ emacs conf/gitolite.conf
add bob.smith@up.ac.za under the website_projectAssignment repo
$ git add keydir/$YOUR_KEY_FILE
$ git commit -a -m "Granted Bob Smiths Desktop access to the Project Assignment Website repo"
$ git push
Bob smith should now be able to clone the website_projectAssignment repository from his Desktop.
To edit the git/gitolite hooks,
$ ssh adymond@mecheng.up.ac.za
$ sudo su gitolite
$ cd /home/gitolite/repositories/website_ProjectAssignment.git/
Then proceed to change the desired settings.
For example, to change the git post-commit email reciepients edit the config file under website_ProjectAssignment.git
This very basic example demonstrates how to patch the project assignemt website. Before begginning, its advised to first pull the latest version of the website:
$ git pull #needs to done from inside the website_projectAssignment directory
Edit the code, and then test locally using ./manage.py runserver. Once everything is in order, commit the changes and push it back to mecheng. To see which files have been changed, check the repo status
$ git status
Commiting
$ git commit -a -m 'fixed problem with drop list on students reservation form'
Then Push
$ git push
After the repo has been updated, ssh into mecheng. Then Update the production side version of the website project assignment website and reload the apache 2 server:
$ ssh mecheng.up.ac.za
$ cd ~/website_ProjectAssignment/
$ git pull gitolite@mecheng:website_ProjectAssignment master
$ sudo service apache2 reload
That it folks.