Project

General

Profile

RedmineRepositories » History » Version 17

Jean-Philippe Lang, 2009-05-12 20:31
svn 1.6 tested

1 1 Jean-Philippe Lang
h1. Repositories
2
3 16 Jean-Philippe Lang
Redmine natively supports integration with different SCM: "Subversion":http://subversion.tigris.org/, "CVS":http://www.nongnu.org/cvs/, "Mercurial":http://www.selenic.com/mercurial/, "Darcs":http://darcs.net/, "Git":http://git.or.cz, and "Bazaar":http://bazaar-vcs.org/.
4 1 Jean-Philippe Lang
5 16 Jean-Philippe Lang
Note that you need to install the appropriate binaries on your Redmine host and make sure that these binaries are availble in the PATH environment variable:
6 9 Jean-Philippe Lang
7
|*SCM*|*Tested with*|*Comments*|
8 17 Jean-Philippe Lang
|Subversion|1.3 & 1.4 & 1.5 & 1.6|1.3 or higher required|
9 9 Jean-Philippe Lang
|CVS|1.12.12|1.12 required, won't work with CVSNT|
10
|Mercurial|0.9.3| |
11
|Bazaar|1.0.0.candidate.1| |
12 16 Jean-Philippe Lang
|Darcs|1.0.7||
13
|Git|1.5.4.2||
14 9 Jean-Philippe Lang
15 1 Jean-Philippe Lang
For exemple, if you want to access Subversion repositories in Redmine, you'll have to install the svn binaries on the Redmine host.
16
17
h2. Attaching an existing repository to a project
18
19
In the project settings, make sure that the 'Repository' module is enabled and go to the 'Repository' tab.
20
Select the SCM that corresponds to your repository and enter the path or URL of your repository.
21
22 2 Jean-Philippe Lang
*Important*: When you first browse the repository, Redmine retrieves the description of all of the existing commits and stores them in the database.
23 1 Jean-Philippe Lang
This is done only once per repository but can very long (or even time out) if your repository has hundreds of commits.
24
25
To avoid this, you can do it offline.
26
After having your repository declared in Redmine, run the following command:
27
28
  ruby script/runner "Repository.fetch_changesets" -e production
29
30
All commits will be retrieved in the Redmine database.
31
32
h3. Subversion repository
33
34
Usual protocols are supported (eg. @http:@, @svn:@, @file:@), just enter the URL of the repository.
35
36 14 Azamat Hackimov
Example:
37 1 Jean-Philippe Lang
38
<pre>
39
http://host/path/to/the/repository
40
</pre>
41
42
You can specify a username and password if the repository requires authentication.
43
44
Note: if you want to access the repository using @svn+ssh://@, you'll have to configure svn+ssh to be non-interactive.
45 5 Jean-Philippe Lang
This requires to setup a public/private key pair for ssh authentication.
46
47
h3. CVS repository
48
49
Enter:
50
* the URL of the repository (it can be either a path or a connection string, eg. @:pserver@).
51
* the module name
52
53 15 Azamat Hackimov
Example:
54 1 Jean-Philippe Lang
55 7 John Goerzen
  :pserver:login:password@host:/path/to/the/repository
56 10 Thomas Lecavelier
57
h4. Git repository
58
59
Redmine request a *bare* and *local* repository to enable browsering.
60
Image you want to browse the to-do list manager project Donebox: its clone URL is git://github.com/ook/donebox.git
61
On the server where you're running redmine, create a directory accessible by the user running your redmine server:
62
<pre>
63
$ sudo mkdir -p /var/redmine/git_repositories
64
$ sudo chown rails:rails /var/redmine/git_repositories
65
$ cd /var/redmine/git_repositories
66
</pre>
67
Note the second line: it change the owner of the newly created directory to user rails, group rails. Of course, you have to replace it according to your server settings (it can be www-data or for very bad sysadmin: root). Keep in mind this user have to be able to run the _git_ command.
68
69
Now it is time to create our bare repository:
70
71
<pre>
72
$ pwd
73
/var/redmine/git_repositories
74
$ git clone --bare git://github.com/ook/donebox.git
75
Initialized empty Git repository in /var/redmine/git_repositories/donebox/
76
remote: Counting objects: 401, done.
77
remote: Compressing objects: 100% (246/246), done.
78
remote: Total 401 (delta 134), reused 401 (delta 134)
79
Receiving objects: 100% (401/401), 179.55 KiB | 185 KiB/s, done.
80
Resolving deltas: 100% (134/134), done.
81
</pre>
82
83
You're done! Just go to your redmine project setting tab, under the repositories choose git, then put in the "Path to .git directory" */var/redmine/git_repositories/donebox/*. Save. Have a look to your repository tab: you can browse it.
84 11 Thomas Lecavelier
85
Note: of course, this git repository won't update by itself. You'll have to git pull it regulary by hand or set up a cron job which will do it for you.