Difference between revisions of "Git Hosting"

From CSCWiki
Jump to navigation Jump to search
Line 24: Line 24:
git push gitea master
git push gitea master
If there are any other branches, push them as well.

Revision as of 01:45, 21 June 2021

We have a gitea instance running off of caffeine. You can sign in via LDAP to the web interface. Projects used by CSC as a whole are owned by the public organization.


"It's basically GitHub"

- raymo

Pushing and pulling from the filesystem

(for syscom only)
If you need to keep the ability to push/pull from the filesystem, in addition to Gitea, you will need to make sure that the repo directory is owned by a group in which you are a member, and is group-writable. For example, let's say we want to make sure that everyone in the syscom group can push to a repo called 'keyring'. The way we're doing this right now is kind of hacky, but it works:

  1. Change the name of the repo folder, e.g. mv /srv/git/keyring.git /srv/git/keyring.git.bak
  2. Create a new repo with the name 'keyring' from the Gitea web UI. This should create a bare repository at /srv/git/keyring.git.
  3. Clone the keyring.git.bak repo to somewhere else (e.g. your homedir), add the Gitea URL as another remote, and push to the Gitea remote. e.g.
    cd ~
    git clone /srv/git/keyring.git.bak
    cd keyring.git.bak
    git remote add gitea https://git.csclub.uwaterloo.ca/public/keyring.git
    git push gitea master
  4. Remove the new repo directory and replace it with the old one:
    rm -rf /srv/git/keyring.git
    mv /srv/git/keyring.git.bak /srv/git/keyring.git

    (It appears that it is necessary to push to Gitea at least once for later changes to show up.)

  5. Change file permissions if necessary:
    chown -R git:syscom /srv/git/keyring.git
    chmod g+w /srv/git/keyring.git

    You will need to do this from phosphoric-acid (due to NFS root squashing).

After the steps above, you *should* be able to push to the keyring repo in three ways: Gitea via HTTPS, Gitea via SSH, and via the raw filesystem (i.e. git clone /srv/git/keyring.git). Furthermore, everyone in syscom should be able to push to it via the filesystem.