November 5, 2025

Part 3: add a new repository on your own remote repository running cgit

Previous post: https://yctct.com/cgit-instance-setup-2

Commands I use to add a new repository to git.yctct.com.

Locally:

$ git clone --bare my_project my_project.git
Cloning into bare repository 'my_project.git'...
done.

Then:

$ scp -r my_project.git user@git.example.com:/home/git/repositories

Then I ssh into the git server.

And in /etc/cgitrc, I add:

repo.url=my_project
repo.owner=author
repo.path=/home/git/repositories/my_project.git
repo.desc=description of what this repository is about

Then I go back locally:

Remove the bare repository:

$ rm -fr my_project.git

Set the remote repository as the origin:

$ cd my_project
$ git remote add origin user@git.example.com:/home/git/repositories/my_project.git

Check that the remote was added:

$ git remote -v

Push a new commit to the remote repository:

$ git push --set-upstream origin main

Source: https://git-scm.com/book/en/v2/Git-on-the-Server-Getting-Git-on-a-Server


personal computing command-line interface (cli) gnu linux trisquel shell literacy wiki git cgit hosting

No affiliate links, no analytics, no tracking, no cookies. This work © 2016-2025 by yctct is licensed under CC BY-SA 4.0 .   about me   contact me   all entries & tags   FAQ   GPG public key

GPG fingerprint: 2E0F FB60 7FEF 11D0 FB45 4DDC E979 E52A 7036 7A88