Skip to content

Gitea


Gitea Overview

Gitea is the CS department's self-hosted Git service for students and professors. You can store your work here and have access to all the features you are used to from github. Collaborative development, project management, and version control are all available here.

Features

  • Git Repository Hosting: Gitea provides Git repository hosting, enabling users to manage their codebase efficiently.
  • Pull Requests and Code Reviews: Collaborative development through pull requests and built-in code review functionality.
  • Issue Tracking: A robust issue tracker that supports labeling, milestones, and task management.
  • Wiki & Markdown Support: Integrated wiki system and Markdown support for documentation.
  • CI/CD Integration: Can be integrated with CI/CD pipelines for continuous development workflows.
  • Lightweight and Fast: Requires fewer system resources compared to other Git hosting platforms.
  • Authentication: Supports OAuth2, LDAP, and two-factor authentication for secure access.
  • Self-Hosted: Gitea can be run on your own infrastructure, ensuring full control over your code and data.

How to Add an SSH Key to Gitea

1. Generate an SSH Key (if needed)

If you don't already have an SSH key, you can generate one using the following command:

ssh-keygen -t ed25519 -C "your_email@example.com"

If your system doesn’t support ed25519, you can use:

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
  • Follow the prompts and save the key in the default location (~/.ssh/id_ed25519 or ~/.ssh/id_rsa).
  • Skip the passphrase for easier use with Gitea (though less secure), or set one if you prefer.
  • After generating, your public key will be located in ~/.ssh/id_ed25519.pub or ~/.ssh/id_rsa.pub.

2. Copy the SSH Key

Copy your public SSH key to your clipboard:

cat ~/.ssh/id_ed25519.pub

Or for RSA:

cat ~/.ssh/id_rsa.pub

Then copy the output to your clipboard.

3. Add the SSH Key to Gitea

  1. Log in to your Gitea account.
  2. Go to your User Settings by clicking your profile avatar in the top-right corner and selecting "Settings."
  3. In the left sidebar, under SSH / GPG Keys, click SSH Keys.
  4. Click the Add Key button.
  5. In the Key field, paste your SSH public key that you copied earlier.
  6. Optionally, give the key a title in the Title field.
  7. Click Add Key to save it.

4. Verify the SSH Key

You can verify that your SSH key has been correctly added and is working by trying to clone a repository using SSH:

git clone git@<your-gitea-url>:<username>/<repository>.git

If everything is set up correctly, you should be able to clone and interact with your Gitea repositories via SSH.


migration

  1. Create a New Repository in Gitea Log in to your Gitea instance. Navigate to the pluse symbol on the top right of the screen. Click on the "new mgration" button. Enter the repository name and other details.
  2. Mirror the Repository from GitLab Go to the GitLab repository you want to migrate.

Under Settings > Repository, find the Mirroring Repositories section.

Add your Gitea repository as a new mirror, with the Gitea URL in the form:

https://<your-gitea-url>/<username>/<repo-name>.git

Add your Gitea username and an access token (if required).

Set the direction to "Push."


Useful commands

  1. Clone a Repository To clone a repository using SSH:
git clone git@<your-gitea-url>:<username>/<repository>.git

To clone using HTTPS:

git clone https://<your-gitea-url>/<username>/<repository>.git
  1. Add a Remote If you've already cloned a repository locally, you can add a new remote pointing to your Gitea repository:
git remote add origin git@<your-gitea-url>:<username>/<repository>.git
  1. Push Changes After committing changes, push them to the Gitea repository:
git push origin <branch-name>
  1. Pull Changes Pull the latest changes from the remote repository:
git pull origin <branch-name>
  1. Create a New Branch To create a new branch and switch to it:
git checkout -b <new-branch-name>
  1. Submit a Pull Request (PR) After pushing your changes to a branch, you can submit a pull request by:

Navigating to the repository on your Gitea instance. Go to Pull Requests > New Pull Request and follow the prompts.

Chat with Archibald

Disclaimer

Disclaimer: Archibald is an AI assistant for the ODU CS Systems Group. Information provided is based on internal documentation and policies. The responses are automatically generated and may not always be accurate or complete. The prompts you provide will be used to further develop our AI in the hopes of generating better answers.