Development using git:Cgit

From Alpine Linux
Revision as of 11:41, 7 July 2011 by Fab (talk | contribs) (Clean up)
Jump to: navigation, search

Developers with SSH access can publish their repositories on cgit at

Create a repository

Create a directory on your local computer or somewhere you have access.

mkdir mytest cd mytest

init git and create a first commit

echo "testing" > test.txt git init git add . git commit -m 'initial commit'

Create a bare repo

Clone it to a bare repo

cd .. git clone --bare mytest mytest.git

Set the description

echo "My git/cgit test" > mytest.git/description

Set the section and your name for cgit.

cat <<EOF >> mytest.git/cgitrc > section=Developer Your_alias > owner=Your_full_name > EOF

Note: The 'description' file and 'cgitrc' file are needed to make cgit publish information about your repo.

Upload to

Copy the content to your the ~/cgit directory on

scp -r mytest.git

Clean up

We no longer need the local aports.git directory.

rm -rf mytest.git

Last step

Now ping ncopa or somebody else on IRC in #alpine-devel with the corresponding permissions to create symlinks on and your repository will show up. Once the symlink is created all further repositories will be published on

Add your personal repository

So far git does not know anything about about your repositories.

cd aports git remote add origin ssh://

Add upstream source to merge with

If the project you uploaded is a clone of an existing repository (aports for example), add the original source as a git remote repository ("upstream" can be whatever name you want to assign to the remote repository):

git remote add upstream git://

Then, to synchronize your local copy with upstream then push your changes (might need to fix merge conflicts if/when they happen):

git pull upstream master git push

The quick way

cd .. git clone --bare acf-mystuff acf-mystuff.git echo "My acf-mystuff repo" > acf-mystuff.git/description echo "section=Developer user" > acf-mystuff.git/cgitrc scp -r acf-mystuff.git