Nristen's (g)log
2022-05-25

Self-hosted GIT alternative

Frequently in Gemini, I see mentions of GIT, dislike of github, and alternatives such as Gitea, GitLab and others. At work I use git and we use github for hosting the companies repositories. I have even taught introduction to git classes at a previous employer to encourage the switchover from SVN to Git. I even managed a company hosted instance of GitLab.

I recently read the post:

gemini://alex.flounder.online/gemlog/2022-05-11.gmi

where another alternative called stagit is mentioned.

I believe the need to self-host our own services is very important to preserve our freedom and independance and not become just another victim of Big Tech.

So several years ago, while searching for self-hosted version control options, I stumbled across Fossil.

https://fossil-scm.org

One of the biggest complaints that I see with Git is that a lot of extra setup is required to add features like a web interface with bug-tracking/ticketing, wiki, forum, chat, email alerts and technotes. Then when you finally get all of this setup, it is anything but portable which would be nice for a selfhosted solution. A git server will all of the bells and whistles could run on the likes of a raspberry pi but it would eat up a lot of resources.

Fossil contains all of the above mentioned features in one small binary that for linux is about 7MB. Fossil can be run as a local webserver on your laptop which is only started when you want to access the web interface locally or it can be run as a stand alone webserver which others can access taking advantage of the ticketing system, forums, chat and wiki. The fossil executable is self contained and does not require a bunch of other applications to run ie Apache or Nginx although Fossil can be setup to use these applications. Fossil can even provide a web gui for multiple fossil repositories which is what I do.

I also run this on a raspberry pi that is also running Nextcloud.

The fossil application is created by the same people that produce sqlite so it is not surprising that the repositories themselves are stored in an SQLite database. So copying a repository can be as simple as coping the single database file.

Fossil is not designed for huge projects such as the Linux kernel however, it can be a really good fit for individual projects with multiple contributors. It was designed and is used by the developers of sqlite.

Example commands (terminal) to show the simplicity

Fossil is available in most linux distros through the default package manager however it is just as easy to download the binary for your OS (linux, windows, osx, pi, etc) and run it or copy it to someplace in your PATH.

fossil ui

This opens a local web instance http://localhost:8080 which can only be browsed from the computer where fossil was run.

fossil new <filename for new repository>

creates a new repository

fossil commit -m "commit message"

Commits new changes to the repository.

fossil pull

pulls latest updates from remote repository

fossil push

pushes local changes to remote repository

fossil help

shows the list of fossil commands which can be used

fossil server <repository name or directory containing multiple repos>

starts a fossil webserver which can be accessed from other locations.

--------

Nristen (g)log index

Nristen Home