πŸ‘¨β€πŸ’» about me home CV/Resume πŸ–ŠοΈ Contact Github LinkedIn I’m a Haskeller πŸ“ Blog Freedom, privacy, tutorials… πŸ† Best of panda upp Haskell abp pp hCalc bl todo pwd TPG Nextcloud Git BitTorrent

πŸ“° Friday 2. April 2021: upp is a panda companion. It’s is a Lua-scriptable lightweight text preprocessor.
πŸ†• since December 2020: Playing with the actor model in an embedded multicore context. C imperative components become C stream pure functions with no side effect ➑️ C low level programming with high level pure functional programming properties πŸ†
πŸ“° Saturday 30. January 2021: Playing with Pandoc Lua filters in Lua. panda is a lightweight alternative to abp providing a consistent set of Pandoc filters (text substitution, file inclusion, diagragrams, scripts, …).
πŸ†• Sunday 24. May 2020: Working at EasyMile for more than 4 years. Critical real-time software in C, simulation and monitoring in Haskell ➑️ perfect combo! It’s efficient and funny ;-)
🚌 And we are recruiting! Contact if you are interested in Haskell or embedded softwares (or both).

Git server on Raspberry Pi

Christophe Delord

Goal

GitHub and GitLab are great but if you need private repositories, you may want better privacy and control over your data.

But Git can be installed locally on a Raspberry Pi.

Prerequisites

Raspberry Pi installation

I already have a Raspberry Pi hosting Nextcloud. The same device can be used to install Git.

The home router must be configured to route TCP ports 22 (SSH) to the Raspberry Pi.

Optionnally, a new DNS record can be added to your domain name (e.g.: git.example.com).

Git installation

The procedure described here is a summary of Build your own Raspberry Pi Git Server.

  1. Connect to the Raspberry Pi

    ssh pi@cloud
  2. Ensure git is installed

    sudo apt update
    sudo apt upgrade
    sudo apt install git

Create a repository on the Raspberry Pi

  1. Create a directory

    mkdir -p /home/pi/git/hello
    cd /home/pi/git/hello
  2. Initialize the Git repository

    git init --bare

Create the repository on your PC

  1. Create the repository

    git init
    git remote add hello pi@git.example.com:/home/pi/git/hello
  2. Push the first commit

    git add .
    git commit -m "Initial commit"
    git push hello master
  3. Clone the repository on another PC

    git clone pi@git.example.com:/home/pi/git/hello