Some familiarity with git is recommended: Here you can find the manual pages and some nice tutorial.
If you are using a git version less than 1.5 please have a look at this page!
There's a repository called contrib-test.git that you can use for your very first steps with git. It's not connected to the real contrib.git repository, so you cannot break anything when working with it.
To tell git who you are and to define some useful defaults, set up ~/.gitconfig like this:
[user] email = firstname.lastname@example.org name = Your RealName [push] default = current
Now configure ssh for access at crux.nu: edit ~/.ssh/config and add:
Host crux HostName crux.nu Port 2222 User <username>
$ git clone crux:/home/crux/scm/ports/contrib.git contrib
The previous command should clone the latest available contrib repository into a "contrib" directory. Now run the following commands to configure branches:
$ git branch 2.8 origin/2.8 $ git branch 3.0 origin/3.0
This tells git to grab the necessary branches.
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.
Also note that CRUX 3.0 is the first release for the x86-64 architecture (see details), so you don't need the old 2.8 branch at least you're still maintaining ports for it.
When development for a new CRUX version has started, you can simply add this new branch to your local repository, i.e.:
$ git branch 3.1 origin/3.1
After cloning and initial configuration, select the branch you want to work on, ie:
$ git checkout 3.0
You can list the available branches and display the active one with
$ git branch
$ cd PATH/TO/WORKING/COPY $ cp -r $PATH/myport . $ git add myport $ git commit -m "myport: initial commit" $ git push
$ cd PATH/TO/WORKING/COPY $ git rm -r someport $ git commit -m "someport: removed from repository" $ git push
$ cd PATH/TO/WORKING/COPY/someport (edit files, ie Pkgfile and .md5sum) either: $ git add Pkgfile .md5sum [...] $ git commit -m "someport: updated to 3.22" or directly: $ git commit -m "someport: updated to 3.22" Pkgfile .md5sum [...] $ git push
If you run in trouble with the last command, because someone else has modified the repository in the meantime, run the following commands (ie to "fix" branch 3.0):
$ git fetch $ git rebase origin/3.0 $ git log $ git push
Let's say that you have two branches, 2.8 and 3.0. If you now modify one or more ports in branch 2.8, it's possible to merge these changes easily into another branch, ie 3.0:
$ git checkout 3.0 $ git pull . 2.8
But use this option with care as it will merge all changes (since the last merge) into branch 3.0
$ cd PATH/TO/WORKING/COPY $ git fetch updating branch 3.0: $ git checkout 3.0 $ git rebase origin/3.0 updating branch 2.8: $ git checkout 2.8 $ git rebase origin/2.8