]> scripts.mit.edu Git - www/ikiwiki.git/blob - doc/rcs/git/discussion.mdwn
* table plugin: Actually specify the delimiter when parsing CSV.
[www/ikiwiki.git] / doc / rcs / git / discussion.mdwn
1 ## Migrating from svn to git ##
2
3 I'd like to migrate from svn to git, because git is better in general but also has some nice properties that go well together with my use of ikiwiki.. I only change it myself. I want a single git repo so that my website directory is self-contained so that I don't need to drag around a separate svn repository on my computer. Is it possible to use ikiwiki so that it only uses a git repository in the same dir as all files are stored and edited?
4
5 Otherwise, I hope migrating is just importing the svn repo to git and then setting up ikiwiki to use git. I don't plan to go back to svn after that so git-svn should only do the import.
6
7 ### Solution ###
8 **Basis:** I only use ikiwiki as a wiki compiler. No cgi or anything.
9
10 I imported my svn repo into git with `git-svnimport`. I reconfigured ikiwiki to _not use any rcs_. In `ikiwiki.setup`, I have the git repository as srcdir, and a suitable dstdir. 
11
12 Then, in my git repository, I added this `post-commit` hook to refresh the wiki:
13
14         #!/bin/sh
15
16         # to refresh when changes happen
17
18         BASE="/path/to/base/dir"
19         SETUPFILE="$BASE/ikiwiki.setup"
20         UNDERLAYDIR="$BASE/underlay"
21
22         ikiwiki --refresh --setup "$SETUPFILE" --underlaydir="$UNDERLAYDIR" --verbose   
23
24 Positives:
25
26 * Containment: I only have the above `$BASE` directory to backup: it contains the srcdir and setup files. No external svn repository. This means that suddenly `git` and `ikiwiki` pair into a stand-alone self-contained wiki compiler kit.
27
28 UlrikSverdrup (This is now crossposted to the above mentioned [website][ulrikweb])
29
30 [ulrikweb]: http://www.student.lu.se/~cif04usv/wiki/stuff/git.html