Create Got Repo
This guide explains how to create a got repository. It assumes you have already read the got usage guide.
Create commit group
First, you may want to create a new group with commit rights:
$ doas groupadd commit
For each existing user you want to give commit rights to:
$ doas usermod -G commit $USER
For each new user you want to create with commit rights:
$ doas useradd -G commit $USER
Replace $USER with the committer's user's name.
Create got directory
We are going to place the repo in /var/git:
$ doas mkdir /var/git $ doas chown -R $USER:commit /var/git $ cd /var/git
Next, you can either clone a repo or create a new one:
To clone a repo without encryption (WARNING: insecure):
$ got clone git://example.com/repo.git
example.com/repo.git with your actual path.
HTTP URLs currently requires git?:
$ git clone https://example.com/repo.git
To create an empty repository:
$ got init /var/git/project
project with your actual repo name. For example:
Afterwards, we need to import the code for the repository:
$ got import -m "Import sources" -r /var/git/project /path/to/code
-mprovides the log message for the import.
-rprovides the repository path.
/path/to/code. For example:
$ got import -m "Import sources" -r /var/git/ircnowd ~/ngircd
This will import the code from
Allow commit access
Make sure to set the proper permissions to allow commit access:
$ doas chown -R $USER:commit /var/git/project $ doas chmod -R g+w /var/git/project
To checkout the code:
$ cd ~ $ mkdir ~/project $ got checkout /var/git/project
To commit changes in a work tree:
$ got -m "Commit message" commit
Commit message with a commit message.