Versioning Strategies

Using Tags for Important Versions (e.g., Publications)

< >

Using Tags for Important Versions (e.g., Publications)

In this lesson, you’ll learn how to use Git tags to mark significant versions of your research data or software releases. This practice ensures traceability and makes it easier to reference specific versions in publications, theses, or collaborations.


Prerequisites

Before starting this lesson:

  • Familiarize yourself with basic Git commands (e.g., git commit, git push).
  • Ensure your GitLab repository is set up for versioning research data or software.

Step 1: Identify Key Versions

Determine which versions of your research data or software require special attention (e.g., final release for a paper, milestone release).

Example:

  • A software version v1.0 corresponding to a journal publication.
  • A dataset version 2024-03-15 tied to an experimental result.

Step 2: Create Git Tags

Option A: Create Tags via Command Line

Use the following commands to create and push tags to your local GitLab repository:

# Open the project you want to tag via your terminal, vscode, etc.
cd ~/repos/<your-project>
# Create a lightweight tag for a specific commit
git tag v1.0

# Push the tag to GitLab
git push origin v1.0

Option B: Create Tags via GitLab Web Interface

Alternatively, you can create an annotated tag using the GitLab web interface:

To create a release on the GitLab website:

  1. On the left sidebar, select Search or go to and find your project.
  2. Select Code > Tags.
  3. Select New tag.
  4. Provide a Tag name.
  5. For Create from, select an existing branch name, tag, or commit SHA.
  6. Optional. Add a Message to create an annotated tag, or leave blank to create a lightweight tag.
  7. Select Create tag.

Source and Further Reading