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