Skip to main content

Integrated Code Lifecycle

Every programming exercise gives you a Git repository of your own. Artemis hosts it itself — there is no separate account to create and no other site to sign in to — and builds and tests whatever you push to it.

This page is about getting at that repository: reading it in the browser, cloning it to your computer, and proving who you are when you do. What to do with it once it is cloned is covered by Programming Exercises.

Reading Your Repository in Artemis

Open the exercise and press Code, then the arrow icon beside the repository address. Artemis opens your repository in a read-only view headed Source.

The Source view of a student repository, with the file browser, a Java file, the problem statement and the result of the last push
Your repository in Artemis, with the result of your latest push above it

The file browser on the left lists everything in the repository; selecting a file shows it, and you can read but not edit it here. To the right sits the problem statement, with each task marked by how many of its tests pass. The result of your most recent push sits at the top, beside three actions:

  • Open Commit History lists everything you have pushed.
  • Code shows the repository address again, so you can clone it without going back to the exercise.
  • Download Repository saves the current contents as a ZIP file.

What You Have Pushed

Open Commit History lists what you have pushed, most recent first, in groups numbered down the # column. A group runs up to and including the commit Artemis built, so it is usually one push, and the commits under group 3 are numbered 3.2, 3.3 and so on. The Commits column counts them. Groups open expanded; Collapse all folds each one down to its first row and Expand all opens them again.

The commit history, with three groups, the last carrying three commits numbered 3, 3.2 and 3.3
Three groups, the oldest holding three commits and ending at the template

A result belongs to the group, not to each commit in it. A push of five commits produces one result, against the commit that was built, and the other four rows leave the Result column empty. That is also why a push still being built does not get a row of its own: a group closes when a result arrives, so an unbuilt push is shown together with the one after it.

The last row of the oldest group is marked Template: that is the starting point Artemis put in the repository for you, not something you wrote.

Selecting a commit hash opens a page of its own, headed Commit and the full hash, showing what that commit changed against the one before it — removed lines in red on the left, added lines in green on the right, file by file.

One commit's page, with its author, date and message above a side-by-side diff
One commit, against the commit before it

Cloning the Repository to Your Computer

Code — in the exercise header, or on the Source view — gives you the address to clone.

The clone dialog with the authentication dropdown open, offering Token, SSH and HTTPS
The clone dialog, with the three ways of authenticating

The button on the left of the address chooses how you authenticate, and the address changes with it. A token is masked on screen as **********; Copy URL puts the real address on your clipboard.

The buttons underneath hand the repository straight to a tool instead. Open in … names the IDE you picked under User Settings → IDE Preferences, Clone in Git client opens Sourcetree or Tower, and where your instructor has enabled it, Open online IDE opens an editor in the browser with nothing to install.

Which Authentication Method to Use

MethodSetupScopeWorth knowing
Tokennoneone repositoryThe default, and the right answer for almost every student
SSHa key pair, onceevery repository you can reachWorth the setup if you work across many exercises
HTTPSnoneevery repository you can reachYour Artemis password, typed into Git

Your administrator decides which of the three appear and in what order; the default order is the one above. If one of them is missing from the dropdown, it is switched off for the whole instance.

Token is the one to reach for. Artemis creates an access token for each exercise repository you participate in and puts it straight into the address, so cloning works with nothing set up and the token is useless anywhere else.

HTTPS authenticates with your Artemis password. It works, but it puts your account password into a Git client, and one leaked password exposes everything your account can reach rather than a single exercise.

Cloning From a Terminal

Copy the address from the dialog and clone it. With a token the address already carries everything Git needs:

git clone https://your_login:your_token@artemis.example.org/git/COURSE/course-your_login.git

Over SSH, the key you added to your account is what identifies you:

git clone ssh://git@artemis.example.org:7921/git/COURSE/course-your_login.git

And over HTTPS, Git asks for your password:

git clone https://your_login@artemis.example.org/git/COURSE/course-your_login.git

Any Git client works just as well — the addresses are ordinary Git URLs.

Reviewing and Revoking Your Tokens

User Settings → Access Tokens lists every access token you hold, saying which exercise and repository each one covers. No token value is shown anywhere in Artemis — not here, and not in the clone dialog, which masks it. Copy URL is the only way to get one.

The Access Tokens overview, listing one participation token per exercise with a revoke action
One token per repository, each revocable on its own

Revoking a token stops it working immediately, which is what to do if one has ended up somewhere it should not be — a chat message, a screenshot, a committed file. You are not locked out: the next time you open that exercise's clone dialog, Artemis issues a fresh one.

Setting Up SSH

SSH is worth setting up if you work on many exercises, or if you would rather not have credentials in your Git configuration at all. It is a one-off: you create a key pair, give Artemis the public half, and every repository you can reach then works without anything further.

How It Works

A key pair is two matching files. The private key stays on your computer and is never shared. The public key is the half you hand out — you give it to Artemis, and Artemis recognises you by it from then on.

When you connect, your computer proves it holds the private key without ever sending it. Nothing that crosses the network can be replayed by someone watching, which is what makes SSH worth the setup over a password.

Creating a Key Pair

If you already have a key — ~/.ssh/id_ed25519.pub on macOS and Linux, %USERPROFILE%\.ssh\id_ed25519.pub on Windows — use it. One key can serve any number of sites and repositories.

To create one, run ssh-keygen in a terminal, or in Git Bash on Windows:

ssh-keygen -t ed25519 -C "your_login@your-laptop"

It asks where to save the key — press Enter for the default — and then for a passphrase. Set one. It encrypts the private key on disk, so a copied laptop is not a compromised account.

The comment after -C is only a label, but Artemis offers it as the key's name later. Put the computer in it rather than your email address: what you will want to know in a year is which machine a key belongs to, so that you can remove the right one.

You now have two files: id_ed25519, the private key, which never leaves your computer, and id_ed25519.pub, the public key, which is what you hand to Artemis.

Adding the Key to Your Account

User Settings → SSH lists the keys on your account and is where you add one.

The SSH keys settings page, listing two keys with their hashes, one of them with an expiry date
The keys on your account

Add new SSH key opens the form. Paste the whole contents of your .pub file into Key — the page shows the command that copies it to your clipboard on your operating system.

The Add new SSH key form, with the key field, the label and the expiry choice
Adding a key: the key itself, a label, and how long it should last

Label names the key in the list. Leave it empty and Artemis uses the comment from the key itself. Name it after the computer, so that a key you want to remove later is the one you can recognise.

Expiry decides how long the key stays valid. Do not expire keeps it until you delete it; Expire automatically takes a date and stops it working after that. Setting an expiry on a key you use from a shared or borrowed machine limits what a forgotten key can do.

Save adds the key, and it works immediately. Adding more than one is normal — one per computer means losing a laptop costs you one key, not all of them. Remove a key with the menu beside it.

Checking the Server Fingerprint

The first time you connect over SSH, your Git client shows the server's fingerprint and asks whether to trust it. That is the one moment in SSH where you are trusting something you have not checked, so check it.

Show SSH fingerprints, which the SSH settings page offers once you have added a key, lists Artemis's own. Compare the one your client shows against that list; if they match, you are talking to Artemis. If they do not, stop, and tell your instructor.

The SSH Fingerprints page, listing the fingerprint of the server's host key
Artemis's fingerprints, to check against what your client shows you

Your client only asks once per server. After you have accepted a fingerprint it is remembered, and a later warning that it has changed is worth taking seriously rather than clicking past.

Search documentation