Git for Haiku (#1)

Blog post by nielx on Mon, 2008-04-21 14:25

I would like to announce the availability of the git revision control system. The git website describes it as:

Git is an open source version control system designed to handle very large projects with speed and efficiency, but just as well suited for small personal repositories; it is especially popular in the open source community, serving as a development platform for projects like the Linux Kernel, WINE or

Git falls in the category of distributed source code management tools, similar to e.g. Mercurial or Bazaar. Every Git working directory is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Still, Git stays extremely fast and space efficient.

This document describes how to install the git binary, and how to get the source.

Installing the binary distribution

The most recent binary distribution is hosted by Haikuware, thanks! Have a look at the overview page to see the requirements, especially check if you installed Haiku revision matches the required revision.

After you fetched the binary, you can install it by entering the following commands in the Terminal:

cd /boot/
tar xvfj path-to-download

Git should then be installed.

About the Git Port

I attempted a port of Git to Haiku for several reasons, one of them being that I wanted to do some work on Cairo which uses git for revision control. The actual porting was not too bad. Git heavily relies on the POSIX standard, and a lot of it is implemented on Haiku. The only issues were finding out where Haiku fails. At the same time I was investigating the port, James Woodcock was also working on git. He filed some bug reports on Haiku issues that needed to be fixed. So it is a team effort.

There are two types of changes needed to build git. The first type consists of the hacks that are needed to work around flaws and limitations in Haiku's interfaces. There are currently four commits of this type. The other type are additions that should eventually be contributed back to the git repository. The most prevalent one is an update to the build system for systems dat only support symbolic links and not hard links.

Currently, there is a repository that you can check out with git. It is located at git:// It has two branches. The master branch contains a currently a recent clone of the git repository. It will contain the patches that should be contributed back to the git project. It currently will not build on Haiku without some manual tweaking. The second one is the hack branch, which should work on Haiku. It will be kept up to date to whatever improvements are made to Haiku. Eventually this branch should be deprecated.

Getting and Building the Source

After installing the binaries, you can get and update the source from the repository. To build the source, you need Haiku's development tools, including perl. You can add them when you are building Haiku. Look at the section on the development tools in the second alpha newsletter.

# to get the 'hack' branch
git clone git:// hack

# and to keep it up to date
git pull

To build the source you should perform the following steps:

# create the configure script

# run configure
./configure --prefix=/boot/home/config

The configure script autodetects almost everything, but to the config.mak.autogen file you should add:


Then you can build the source using the regular commands.

If you would like to submit patches to the Haiku port, please send me an email.


Re: Git for Haiku (#1)


Just a couple weeks ago, I was noticing NASM was using Git now...

Looks like it's becoming more popular as an alternative to SVN - glad to see Haiku will be ready and have a Git client.

Re: Git for Haiku (#1)

Ruby on Rails switched to it too. Git definitely has some momentum. I intend to use it for my continuing work on the WebKit port (they have both an SVN and Git repo.) So this could be helpful. It will be interesting to see if it runs as fast on Haiku as it does on other systems.

Also depending on what hacks were needed, I would think Haiku should be fixed in the long term, which is why I assume you say the hack branch is temporary.

Also there are some interesting project sites using Git, namely and I think these will be sort of the next generation of the *Forges (SourceForge, RubyForge, etc.)

Like Urias says, it is good to know Haiku won't be left behind.