Git

The repositories for the packaging in git is stored in a different manner than they are under svn. Each package has it's own git repository (and thus it's own directory) under the /git/pkg-games directory on the alioth servers.

This guide assumes that you are uploading the packaging files for a package for the first time.

A separate section will describe how to import the packaging that was stored in the svn repository in the future.

Creating a git repository

First, create a repository in the /git/pkg-games directory on the alioth servers.

$ mkdir <package>.git
$ cd <package>.git
$ git --bare init --shared

Now edit the 'description' file in the directory you just created to one that is appropriate for the package.

$ echo "Packaging for <package>" >description

Let's also enable the use of 'hooks/post-update'.

$ chmod a+x hooks/post-update

Now we're done creating a repository for the package. You could also use the 'setup-repository' script that's in the pkg-games directory. That script is really a symlink to the script that's used in the collab-maint directory.

./setup-repository <package> '<package description>'

Uploading a package to the repository

Now let's import the package into a git repository. This is easy using 'git-import-dsc' from the 'git-buildpackage' package.

$ git-import-dsc <package>.dsc

A directory with the name of the source package should have been made. Change into that directory.

$ cd <package>

Ensure the tags that are created reflect if a package has been released. git-buildpackage creates tags for the debian branch and the upstream branch. If the tag created for the debian branch reflects an unreleased version, you'll have to delete that "debian" tag.

$ git-tag -l
$ git-tag -d 'debian/<unreleased version>'

Finally, push the repository up to the repository on alioth.

$ git-remote add alioth git+ssh://<username>@git.debian.org/git/pkg-games/<package>.git
$ git-push alioth master
$ git-push alioth upstream
$ git-push alioth --tags

Accessing a repository

To get a repository, do the following.

$ git-clone git+ssh://<username>@git.debian.org/git/pkg-games/<package>.git

You can also enjoy read-only access by using the following.

$ git-clone git://git.debian.org/git/pkg-games/<package>.git
$ git-clone http://git.debian.org/git/pkg-games/<package>.git

To view a summary of the repository on your favorite web browser, go to the following address.

http://git.debian.org/?p=pkg-games/<package>.git

Committing changes

To commit a change, first commit into your local repository.

$ git-commit -m "<some comment>"

You could also do a commit of all files that were changed using the '-a' option.

$ git-commit -a -m "<some comment>"

Push your changes.

$ git-push #If you cloned the repository
$ git-push alioth #If you created the repository using the above example

Updating

To keep updated simply do the following

$ git-pull #If you cloned the repository
$ git-pull alioth #If you created the repository using the above exmple

Tagging

To tag a release, you could build it using 'git-buildpackage' with the '--git-tag' option.

$ git-buildpackage --git-tag

You could also manually tag the package. Ensure that you are in the correct branch (should be 'master').

$ git-checkout master
$ git-tag debian/<revision> -m "Debian release <revision>" #Please use this format

To tag an earlier revision, you'll need to find out it's commit object, then tag that object.

$ git-rev-list --pretty --since="1 month" --all #'1 month' is just an example of course
$ git-tag debian/<revision> <commit object> -m "Debian release <revision>"

Finally, push the tags

$ git-push --tags

See Also