Note: this is a practical description intended for contrib maintainers; for information on how to join the project see the HowToContribute and ContribRules pages.
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, set up ~/.gitconfig like this:
[user]
email = my@myhost.org
name = Your RealName
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.4 origin/2.4 $ git branch 2.5 origin/2.5 $ git branch 2.6 origin/2.6
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.
When development for a new CRUX version has started, you can simply add this new branch to your local repository, i.e.:
$ git branch 2.7 origin/2.7
After cloning and initial configuration, select the branch you want to work on, ie:
$ git checkout 2.6
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 2.6):
$ git fetch $ git rebase origin/2.6 $ git log $ git push
Let's say that you have two branches, 2.5 and 2.6. If you now modify one or more ports in branch 2.5, it's possible to merge these changes easily into another branch, ie 2.6:
$ git checkout 2.6 $ git pull . 2.5
But use this option with care as it will merge all changes (since the last merge) into branch 2.6.
$ cd PATH/TO/WORKING/COPY
$ git fetch
updating branch 2.6:
$ git checkout 2.6
$ git rebase origin/2.6
updating branch 2.5:
$ git checkout 2.5
$ git rebase origin/2.5
updating branch 2.4:
$ git checkout 2.4
$ git rebase origin/2.4