Skip to content

Cloning your team repository

Welcome to ConquerHack! This time, it's on!

To get started, you will need to clone your team's repository. This is where you will find the scaffolds we provide for you to write the bots. It is also where you will push your code to, so that we can run it during the tournament.

Prerequisites

Setting up SSH key for Gitea

To clone your team's repository, you will need to authenticate with the Gitea instance. The recommended and most convenient way to do so is to set up an SSH key for your Gitea account. This way, you won't have to enter your username and password every time you interact with the repository.

  1. Check if you already have an SSH key on your machine, and if not, generate one. Open a terminal and run:

    bash
    ls ~/.ssh/id_*.pub

    If you see a file named id_rsa.pub or id_ed25519.pub, then you already have an SSH key. You can open the file to see the public key:

    bash
    cat ~/.ssh/id_rsa.pub

    If you don't have an SSH key, you can generate one with the following command (replace <email> with your email):

    bash
    ssh-keygen -t ed25519 -C "<email>"
  2. Copy the contents of your public key file (the one ending in .pub, e.g. id_ed25519.pub). You can print its contents in the terminal by running:

    bash
    cat ~/.ssh/id_ed25519.pub

    Or you can open it with a text editor and copy it from there.

  3. Navigate to the ConquerHack Gitea instance.

  4. Click on your profile picture in the top right corner and select Settings.

  5. Select SSH / GPG Keys on the left sidebar and then under Manage SSH Keys, click on Add Key.

  6. Give your key a name (e.g. "My Key") and paste the contents of your public key into the Content field. Then click on Add Key.

  7. You should see a success screen similar to the one below.

    The SSH key is now added to your Gitea account and can be used to authenticate.

  8. (Optional) If you did not save the key to the default location (~/.ssh/id_ed25519), you may need to add it to your SSH configuration. You can do this by adding the following lines to your ~/.ssh/config file (create the file if it doesn't exist):

    Host git.conquerhack.ch
        HostName git.conquerhack.ch
        User git
        IdentityFile ~/.ssh/your_key_file
        Port 2222

    Replace your_key_file with the name of your private key file (without the .pub extension).

Getting the URL of your team's repository

First, let's find the URL of your team's repository.

  1. Navigate to the ConquerHack Gitea instance.

  2. Log in with your Gitea account. If you do not have one yet, wait for us to create it for you and send you the credentials, or tell us if you think you should have received credentials but haven't.

  3. Navigate to the ConquerHack Organization.

  4. Under Repositories, you should see one repo whose name starts with team-. This is your team's repository. Click on it.

  5. On the repository page, click on the Code button and copy the URL under SSH.

We will refer to this URL as <repo-url> in the next steps. We also refer to it as ssh://git@git.conquerhack.ch:2222/ConquerHack/<team-name>.git, where <team-name> is the name of your team, or simple your team's repository URL.

Cloning the repository

Now that you have the URL of your team's repository, you can clone it to your local machine.

  1. Open a terminal and navigate to the directory where you want to clone the repository. For example, you can run:

    bash
    cd ~/projects
  2. Run the following command to clone the repository (replace <repo-url> with the URL you copied in the previous step):

    bash
    git clone <repo-url>

    This will create a new directory with the name of your team's repository (e.g. team-1) and clone the contents of the repository into it.

  3. Navigate into the cloned repository:

    bash
    cd team-1

Congratulations! You have successfully cloned your team's repository. You can now start working on your bot by opening the project in your preferred IDE and tinkering with the code.

As a next step, we recommend you to read the provided guides. They are meant to direct your efforts in the right direction and show you what is possible to do with the bot. You can also check out the API reference to see all the available methods and classes you can use in your bot.