Git on Groupnix Documentation

Home Users Services Docs

tl;dr

Each user on Groupnix has access to their own git user. Git repositories can be viewed using the web front end at git.buni.party. This front end is running the gitbrowse software. The web front end can only be used for viewing the repositories. Additionally, repositories can be cloned over HTTP using the provided clone URL. For a user USER with repository REPO, the clone URL will be of the form https://git.buni.party/USER/REPO.git.

Importing SSH Keys

In order to create or modify a git repository, you must first import an ssh key into the git server system. To do this, log into your user at USER@u.buni.party. You will have a file at ~/.ssh/git_keys. This file will hold the SSH public keys that you want to be able to access your git repos. Note that these keys cannot be shared between users. Sharing git accounts is frowned upon but if you are sure that you want to do it, you must generate additional SSH keys to ensure no collisions between users. The git_keys file will have the same format as the authorized_keys file you already have. Now, the keys must be imported into the git server. Keys are automatically imported every 12 hours but this process can be expedited. To import immediately, run the command sudo /opt/bin/git-import-now. The sudo part is necessary since the command will fail without the necessary permissions.

The majority of the git server administration happens through SSH. Once your keys are imported into the system, run ssh git@buni.party help to view all available git server commands.

Creating Repositories

Repo creation is done through the new command in the SSH interface. Creating a new repo "REPO" under your user "USER" can be done using these commands:

ssh git@buni.party new USER/REPO          # create a new public repo
ssh git@buni.party new USER/REPO private  # create a new private repo

Once the repo has been created, you can pull it and push to the URL git@buni.party:USER/REPO. Pushing repos must be done using the SSH URL.

Repo Visibility

The git server supports both public and private repositories. Repo visibility is managed using the visibility command:

ssh git@buni.party visibility USER/REPO show     # show repo visibility
ssh git@buni.party visibility USER/REPO public   # set the repo public
ssh git@buni.party visibility USER/REPO private  # set the repo private

While repositories can only be pushed over SSH, public repos can be cloned over HTTPS. This URL is of the form https://git.buni.party/USER/REPO.git. Private repositories, however, can only be accessed by their owner and only using SSH.

Deleting Repositories

To delete a repository, run ssh git@buni.party delete USER/REPO. Note that you can only delete repositories that you own. The command will ask for confirmation before deleting.

tl;dr

  1. Add an SSH public key to ~/.ssh/git_keys
  2. Run sudo /opt/bin/git-import-now
  3. Create a repo by running ssh git@buni.party create USER/REPO
  4. Push your repo to git@buni.party:USER/REPO
  5. Browse your repo over the web
  6. Private it using ssh git@buni.party visibility USER/REPO private
  7. Delete it using ssh git@buni.party delete USER/REPO