From d7501b1bd65082f3b44a1bbe8fd43fc3ab917278 Mon Sep 17 00:00:00 2001 From: ozpv <39195175+ozpv@users.noreply.github.com> Date: Sat, 30 May 2026 15:08:19 -0500 Subject: finish --- public/blog/how-to-setup-a-git-server-and-cgit.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'public/blog/how-to-setup-a-git-server-and-cgit.html') diff --git a/public/blog/how-to-setup-a-git-server-and-cgit.html b/public/blog/how-to-setup-a-git-server-and-cgit.html index 6f381f2..d54beda 100644 --- a/public/blog/how-to-setup-a-git-server-and-cgit.html +++ b/public/blog/how-to-setup-a-git-server-and-cgit.html @@ -8,6 +8,7 @@

This guide is a modified version of the git book instructions for Debian specifically.
It also includes setting up a cgit web front-end that allows you to view your git repositories conveniently on the web just like I do.

I'm assuming you already have a VPS with Debian installed and a domain purchased with proper DNS records pointing the git subdomain to your server IP. If not, you should research what all that means before continuing because you'll be unable to follow along.

+

Posted: Saturday May 30, 2026 2:45:23 PM

Setting up a Git Server

The very first thing to do is connect to your server, install git, create a git user, and set up ssh for remote access to that git user.

ssh root@example.com
@@ -19,7 +20,7 @@ cd
 mkdir .ssh && chmod 700 .ssh
 touch .ssh/authorized_keys && chmod 600 .ssh/authorized_keys
 
-

To copy your home computer's ssh id to your server (assuming you have one generated), run this command on your home computer:

+

To copy your home computer's ssh id to your server (assuming you have one generated), run this command:

ssh-copy-id git@example.com
 

Now let's create an example git repository and try to push from our home computer.

@@ -72,12 +73,12 @@ Connection to example.com closed.

Perfect!

Next Steps

-

At this point, your git server is fully usable, and you can begin to push, pull, etc. However, you might also want a front-end to browse your repositories and make them discoverable on the web.

-

How to Set up Cgit for a Git Web Front-End

+

At this point, your git server is fully usable. You can begin to push, pull, etc. However, you might also want a front-end to browse your repositories and make them discoverable on the web.

+

How to Set up cgit for a Git Web Front-End

Install the necessary packages:

apt install nginx certbot fcgiwrap cgit
 
-

Generate a tls certificate for your git domain, then create a cron job to auto-renew it.

+

Generate a TLS certificate for your git domain and create a cron job to auto-renew it.

certbot certonly --standalone --register-unsafely-without-email -d git.example.com
 crontab -e
 
@@ -127,7 +128,7 @@ crontab -e # see cgitrc(5) for details # copy your logo into /usr/share/cgit and change the file name here -logo=/logo.webp +logo=/bunny.webp root-title=example root-desc=a web front-end for my git repositories @@ -135,7 +136,7 @@ root-desc=a web front-end for my git repositories favicon= css=/cgit.css -# for clean repository names +# repository names remove-suffix=1 clone-prefix=https://git.example.com -- cgit v1.2.3