Table of Contents
DokuWiki Git Repository
The DokuWiki sources are managed through the Git version control system. Git is a free and open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Git is NOT offered as optional version control backend for DokuWiki itself. Refer to the (closed) bounty Version control with branching.
How to use Git
Instead of repeating things that were said elsewhere I just want to give some pointers:
- Working with branches: Commits and Pull Requests (by jQuery Community)
There are also some good books about Git:
- Scott Chacon - Pro Git (ISBN 978-1-43021-833-3) – You can read it online for free (CC licensed). Translations are also available (e.g. German).
- Ben Lynn - Git Magic (ISBN 978-1-45152-334-8) – You can read it online for free (GPL licensed). Translations are also available (e.g. Spanish).
- Travis Swicegood - Pragmatic Version Control Using Git (ISBN 978-1-93435-615-9)
- Jon Loeliger - Version Control with Git (ISBN 978-0-59652-012-0)
Before you start using Git, you should configure it with your name and email address:
git config --global user.name "Your Name Comes Here" git config --global user.email email@example.com
And optionally setup colors and few helpful aliases:
git config --global color.ui auto git config --global alias.st status git config --global alias.ci commit git config --global alias.up pull --rebase
Using Git for DokuWiki
To fetch the current development version of DokuWiki use the following command (This creates the directory dokuwiki for you):
git clone git://github.com/splitbrain/dokuwiki.git
To update an existing checkout use this command from within the DokuWiki directory:
When you create a new source file, use this command to add it to the Git repository:
git add somenewfile
When you changed some already tracked files, you need to tell Git about it:
git add --patch
--patch will interactively ask you what parts you want to check in (very much like darcs behaved)
When you're finished with your changes use:
This will scan your local Git repository to find the changes that have occurred and will locally “commit” your changes so that they are not overwritten by a
pull. Unlike CVS it doesn't actually send the files anywhere at this point though. It's more like a “local tag” for your own copy of the code.
To get your changes included in the official tree, create a patchfile:
git format-patch origin/master
This creates one (or more) numbered patch files that can be mailed manually to the mailinglist.
Tips and Tricks
- Always pull before starting to work on new patches, to make sure you don't create conflicts.
- Make sure your editor does not change line endings (from Unix LF to DOS CRLF), this would result in a complete file replace, instead of a small patch because each line was changed.
- Make a patch for a single feature. When you worked on two different features (eg, a language fix and a function update),
committwo patches, with one for each feature. Using the
addmakes that easy for you by asking what to include in the patch.
- A web interface to the Git repository is available at https://github.com/splitbrain/dokuwiki
Mixing the official tree with own patches
Maintaining a stable version with Git
Git isn't only for DokuWiki developers. It can be used to get the latest stable version and to update to the next stable version when it is released. To do so you need to clone the repository but checkout the stable branch:
git clone --branch stable https://github.com/splitbrain/dokuwiki.git
Now you can pull all needed updates whenever a new release is made:
cd dokuwiki git pull