DokuWiki

It's better when it's simple

User Tools

Site Tools


Sidebar

Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community


Follow us on Facebook, Twitter and other social networks.

devel:git

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 closed (and not completed nor started) bounties.

How to use Git

Instead of repeating things that were said elsewhere I just want to give some pointers:

There are also some good books about Git:

Git Configuration

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 you@yourdomain.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:

git pull

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

The --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:

git commit

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), add and commit two patches, with one for each feature. Using the –patch option for add makes that easy for you by asking what to include in the patch.
  • Patches should be sent to the mailinglist and you should explain what they do and why, but we really prefer pull requests.
  • A web interface to the Git repository is available at https://github.com/splitbrain/dokuwiki

Mixing the official tree with own patches

FIXME explain branches

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
devel/git.txt · Last modified: 2016-01-24 18:49 by Aleksandr