Using GIT revision control: a quick guide for JForces Developers

Installing Git

Git comes as a standard package for most distributions of Linux these days. Just use the standard software installer for SUSE and look for it. In addition to the git package, be sure to install the gitk package.

Configuring Git

First off you should put your own information into git to better track who is doing what. Type the following commands in a terminal, but replace the contents of the quotes with your information (and still type the quotes).
  git config --global user.name "Your Full Name"
  git config --global user.email "Your Email Address"

Checking out repositories

The basic syntax for checking out a git repository over ssh (like JForces uses) is:
  git clone ssh://(username)@(servername)/(root directory)/(repository)
The quickest way to check out all the repositories needed to compile JForces is to open up a terminal and do the following all with the same terminal.
These instructions assume you are using the c shell, if you are not sure enter the command "csh".
Check to make sure you are in the correct working directory. Chances are you'll want to be in /home/forces, so run "cd /home/forces" or cd to where ever you'd like.
Next set a variable equal to the user name you have on the CVS/git server by typing the following in a terminal (replace the contents of the quotes with your information).
  setenv REMOTE_USER "your user name"
Next just copy and paste the following commands into the terminal.
  git clone ssh://$REMOTE_USER@CVS_SERVER/forces_git/cshrc
  git clone ssh://$REMOTE_USER@CVS_SERVER/forces_git/scripts
  git clone ssh://$REMOTE_USER@CVS_SERVER/forces_git/tools
  git clone ssh://$REMOTE_USER@CVS_SERVER/forces_git/data
  git clone ssh://$REMOTE_USER@CVS_SERVER/forces_git/interfaces
  git clone ssh://$REMOTE_USER@CVS_SERVER/forces_git/pcomm
  git clone ssh://$REMOTE_USER@CVS_SERVER/forces_git/sim
  git clone ssh://$REMOTE_USER@CVS_SERVER/forces_git/wn
  git clone ssh://$REMOTE_USER@CVS_SERVER/forces_git/Autogen
  git clone ssh://$REMOTE_USER@CVS_SERVER/forces_git/db_patches
  git clone ssh://$REMOTE_USER@CVS_SERVER/forces_git/rap
  git clone ssh://$REMOTE_USER@CVS_SERVER/forces_git/behavior
  git clone ssh://$REMOTE_USER@CVS_SERVER/forces_git/forcesMap
  git clone ssh://$REMOTE_USER@CVS_SERVER/forces_git/rcvr
  git clone ssh://$REMOTE_USER@CVS_SERVER/forces_git/common
  git clone ssh://$REMOTE_USER@CVS_SERVER/forces_git/libraries
  git clone ssh://$REMOTE_USER@CVS_SERVER/forces_git/tcl_stuff
  git clone ssh://$REMOTE_USER@CVS_SERVER/maestro_git/exec
  git clone ssh://$REMOTE_USER@CVS_SERVER/maestro_git/behavior-runtime

Adding files

Adding a new file to the repository is simple just run "git add (file name)". Then commit the file.

Committing changes

When committing changes it is important to remember that there are 2 levels of commits. First off when you run the command "git commit -a" it commits all files you have made changes to into the local repository on your machine. This won't contact the server and will not allow anyone else to see your changes yet. The command "git push" will then add all of your local commits in the current branch to the server. The push command will fail if there are changes on the server that you do not have locally.

Updating from the server

To merge local changes with any differences on the server run the command "git pull".

Other Tools to be aware of

To browse the various revisions and differences between them use the "gitk" command. Make sure you are in a directory that is under git when you run it such as "/home/forces/sim", it will not work if you run it in "/home/forces".

Additional Information

The official git website with documentation is located here: http://git-scm.com/