You will need to install git.
There is a Debian package called
git-core that you can install if you use Debian or Ubuntu. If you are using Windows, then visit http://code.google.com/p/msysgit/. Mac OS X users may visit http://code.google.com/p/git-osx-installer/. Otherwise, visit http://git.or.cz and download the latest source.
If you are a developer that is registered with the ERC project on Savannah, you will want to do the following, replacing
loginname with your Savannah login name.
git clone ssh://email@example.com/srv/git/erc.git
Note that this will not work until you have added your SSH key to Savannah.
If you do not have developer access but wish to track the latest development changes, do one of the following instead. If you are behind a restrictive firewall, use the second method; otherwise, use the first method.
git clone git://git.sv.gnu.org/erc.git
git clone http://git.sv.gnu.org/r/erc.git
To see a list of the available branches, run the following command in the checked out copy of ERC.
git branch -r
Here is a description of the available branches.
|The branch you are currently on|
|Main development branch|
|Emacs 23 integration branch|
|Experimental branch containing erc-status.el, which can show a status icon in the notification area. Requires Emacs from CVS, plus the systray support patch.|
If you want to browse the available branches via the web, visit http://git.sv.gnu.org/gitweb/?p=erc.git;a=summary.
The default branch that you get when cloning the ERC project is
To see which branch you are currently on, do:
To check out a branch, do the following. This changes the contents of the current directory to match that branch, rather than creating a new directory.
git checkout [branch name]
For the shared branch, this would be the following.
git checkout master
To keep up-to-date on the latest ERC happenings, run git’s
pull command from the directory that contains your copy of ERC.
git pull origin
This will update ERC, taking care to preserve any changes that you have checked in to your local copy.
If you have made some changes that you would like to commit to the ERC project, first you will need to provide a name and email address. This information is used in the change log for each change you commit. To do this, edit the
.gitconfig file in your home directory to include the following contents.
[user] name = Your Name Goes Here email = firstname.lastname@example.org
Now you are ready to make the change log, and then commit. Read on for the change log instructions before doing the commit.
If you wish to commit just a few files that you have changed, instead of all the files that you have changed, then do the following.
git add changed-file-1 git add changed-file-2 git commit
If you instead wish to commit all changes in one go, then do:
git commit -a
In both cases, git will open an editor that you can use to make a log message. Add a brief one-line description of your changes at the top of the file.
The rest of the file (keeping a blank line after the very first line) is for describing your changes in detail. If you want, you can either leave this blank or just copy the relevant part of your ChangeLog entry here. The information you use here will appear in the erc-commit mailing list when you are done, once you have either pushed your changes or a developer has committed a patch that you have sent.
Here is one example of an acceptable commit log.
erc-track: Allow switching to buffer with most important message type first * erc-track.el (erc-track-switch-direction): Add 'importance option. (erc-modified-channels-display): If erc-track-switch-direction is 'importance, call erc-track-sort-by-importance. (erc-track-face-priority): New function that returns a number indicating the position of a face in erc-track-faces-priority-list. (erc-track-sort-by-importance): New function that sorts erc-modified-channels-list according to erc-track-face-priority. (erc-track-get-active-buffer): Make 'oldest a rough opposite of 'importance. * NEWS: Mention this change.
If you have changes that you have committed to ERC, they are only local to your copy of ERC so far. If you want to share them, you must either push them back to the shared repo, or email them to the erc-discuss AT gnu.org mailing list.
If you have developer access to the shared archive, you can push changes back by doing:
git push origin
If you do not yet have developer access, read on.
You may send your changes via email by doing:
git format-patch -M origin
and then sending the generated patch files to the erc-discuss mailing list. Be sure to describe your changes and include a sample ChangeLog entry for them. Be sure that the patch is the body of the message, and not an attachment. Any comments that you wish to make, but don’t want to appear in the commit log, should be placed between the “
---” and the diffstat.
If you want to send the resulting patches from the commandline, rather than opening up an email client, you can do the following, where PATCH-FILE is the file that
git format-patch made:
git send-email --to email@example.com PATCH-FILE
If you want commit access to the shared ERC repository on Savannah, then register an account at http://sv.gnu.org/ (be sure to add an SSH key), browse to the ERC project at http://sv.gnu.org/p/erc, and request to be add to the group. It would be best to send some patches to the erc-discuss AT gnu.org mailing list first, so that we know that you know what you are doing.
You must also be willing to sign a copyright assignment for your changes to ERC, since ERC is a GNU project. The current maintainer (mwolson AT gnu.org) will assist you in this process if you contact him.
DVC (see DistributedVersionControl) is a highly-recommended Emacs add-on that allows you to see changes that you have made, log messages, and (eventually) merging changes easily between branches.
Alternatively, the development version of Emacs should include some regular VC bindings for git, so that you can use the same key-bindings that you would use for CVS.
git’s documentation may be browsed at the git website. There has been a significant effort since March 2007 to make the documentation more thorough and easy to read. Several tutorials are there, as well as a User’s Manual.