- Table of contents
Here are some tips that may help you in managing your repository in Redmine. These are particularly helpful if you push and pull from many places.
There is a good introductory video by Randal Schwartz.
Email notification on pushes¶
Chris Green and Marc Mengel have packaged up the git-comit-notify ruby scripts on cdcvs for use in Git repositories.
To set it up:
- add a config/mailinglist.cfg to your repository, with
a comma separated list of email addresses [Note that as of the recent email service changes,
it must be "email@example.com" and not just "user"]. This file has to exist on the "master" branch.
- login to your p-project account
ln -s /local/ups/db/fnal_git_notifier/current/bin/post-receive .
and you should be in business.
There is now an alternate script, which uses a mailinglist config from your Redmine project settings.
proj=my_project cd /cvs/projects/$proj/hooks ln -s /fnal/ups/db/fnal_git_notifier/current/scripts/fnal-git-notify-redmine post-receive
and put in your projects/Settings in the mailinglist box
Add a Redmine remote¶
To save you the keystrokes of having to type the full ssh url every time you push or pull from your repository, you can add a remote. For the following example, I'll call the new remote
git remote add redmine ssh://firstname.lastname@example.org/cvs/projects/project
Now, I can push and pull from my redmine repository by just specifying the remote name
[user@localhost project]$ git push redmine master Counting objects: 7054, done. Delta compression using up to 4 threads. Compressing objects: 100% (6166/6166), done. Writing objects: 100% (7054/7054), 5.59 MiB | 2183 KiB/s, done. Total 7054 (delta 4739), reused 899 (delta 668) To ssh://email@example.com/cvs/projects/project * [new branch] master -> master [user@localhost project]$
Setting up a mirror with GitHub¶
If you want to mirror a repository on GitHub, for project myproject:
- make an ssh key for firstname.lastname@example.org (ssh in as email@example.com and use ssh-keygen)
- setup a repository on github, and allow that ssh key in.
- add a git remote: ssh in as firstname.lastname@example.org and do:
git --git-dir=/cvs/projects/myproject remote add --mirror github github-url
- add a
git push --quiet github &
to the /cvs/projects/myproject/hooks/post-receive hook file.
That's the outgoing side of the mirror (cdcvs->github)
- To make it bidirectional, you could add a crontab entry:
*/30 * * * * git --git-dir=/cvs/projects/myproject fetch --quiet github
That's the incoming side of the mirror (github->cdcvs)
But do NOT do that. We are currently evaluating the security implications of
allowing GitHub to athenticate pushes which then automatically propogate to
Getting tarballs of releases¶
If you're using Git, and your package is "public" you can
to get version $v of package $p as a gzipped tarfile. $v must exist as a tag in the
Supported archive/compression suffixes are:
- tar (tar, no compression)
- tgz (tar, gzip)
- tbz2 (tar, bzip2)
- zip (zip archive, compression)