CRUX : Home

Home :: Documentation :: Download :: Development :: Community :: Wiki :: Ports :: Bugs :: Links :: About

The following commands should only be used with git version less than or equal to 1.4!

Before starting

To tell git who you are, set up ~/.gitconfig like this:

    email =
    name = Your RealName

Now configure ssh for access at edit ~/.ssh/config and add:

Host crux
    Port 2222
    User <username>

Getting the repository

$ git clone crux:/home/crux/scm/ports/contrib.git contrib

Configuring branches

The previous command should clone the latest available contrib repository into a "contrib" directory. Now edit contrib/.git/remotes/origin to configure branches:

URL: crux:/home/crux/scm/ports/contrib.git
Pull: refs/heads/master:refs/heads/origin
Pull: refs/heads/2.2:refs/heads/2.2
Push: refs/heads/2.2:refs/heads/2.2

This tells git to push/pull your local "2.2" branch to/from the remote "2.2" branch. Note that the new contrib repository has one branch for each CRUX version, thus giving the possibility to work on a future release and backport updates to a previous one, much like the core and opt collections.

When developement for a new CRUX version has started, you can simply add a couple of lines to contrib/.git/remotes/origin, ie:

Pull: refs/heads/2.3:refs/heads/2.3
Push: refs/heads/2.3:refs/heads/2.3

Checking out a branch

After cloning and initial configuration, select the branch you want to work on, ie:

$ git checkout 2.2

You can list the available branches and display the active one with

$ git branch

Adding a port

$ cp -r $PATH/myport .
$ git add myport
$ git commit -m "myport: initial commit"
$ git push origin

Removing a port

$ git rm -f someport
$ git commit -m "someport: removed from repository"
$ git push origin

Modifying a port

$ cd PATH/TO/WORKING/COPY/someport
(edit files, ie Pkgfile and .md5sum)
    $ git-update-index Pkgfile .md5sum [...]
    $ git commit -m "someport: updated to 3.22"
or directly:
    $ git commit -m "someport: updated to 3.22" Pkgfile .md5sum [...]
$ git push origin

If you run in trouble with the last command, because someone other has modifiy the repositiory in the meantime, run the following commands:

$ git fetch
$ git rebase origin
$ git push origin

Updating your working copy

$ git pull origin