Session 12: Tags, Releases & Publication

Track, organize and share your work: An introduction to Git for research

Course at University of Hamburg & Erasmus University Rotterdam

Slides | Source

License: CC BY 4.0 DOI

January 17 2025 (10:15 am)

1 Logistics & Admin

Schedule

No Date Title Contents Reading Survey/Quiz
1 2024-10-18 Introduction to version control Organizational matters
Overview of seminar sessions
Introduction to version control
Introduction to Git and its advantages
Intro to version control Course introduction Survey
2 2024-10-25 Command line File Systems
Benefits of the Command Line
Basic Command Line commands
Command Line Command Line Quiz
3 2024-11-01 Setup + Git Fundamentals Installation and configuration of Git
Initializing a Git repository
Basic Git commands
Installation, Setup, First steps with Git Installation Survey, Git Basics Quiz
4 2024-11-08 Basic Git workflow Practicing basic Git commands
Ignoring files with .gitignore
Good commit messages
First steps with Git Git Basics Quiz
5 2024-11-15 Git Essentials (Repetition & Practice) Practicing basic Git commands
Ignoring files with .gitignore
Good commit messages
Git Essentials Git Basics Quiz
6 2024-11-22 Git Branching and Merging Understanding branches in Git
Creating and switching between branches
Merging branches
Resolving merge conflict
Branches Git Branches Quiz
7 2024-11-29 Quarto Workshop Introduction to Quarto
8 2024-12-06 Introduction to GitHub Introduction to remote repositories
Creating a GitHub account
Creating and managing repositories on GitHub
Pushing and pulling changes
GitHub Intro GitHub Quiz
9 2024-12-13 GitHub with collaborators Cloning a remote repository
Branching and merging in a collaborative environment
Pull Requests
GitHub Issues
Graphical User Interfaces (GUIs), e.g., GitKraken
GitHub Intro, GitHub Issues GitHub Quiz
10 2024-12-20 Repetition and Practice Repetition and Practice
11 2025-01-10 Git(Hub) with the world Forking a remote repository
README files
Project Management
GitHub Advanced, GitHub Issues GitHub Quiz
12 2025-01-17 Publishing Creating Tags with Git
Creating Releases with GitHub
Zenodo for publishing
Tags and Releases
13 2025-01-24 Graphical User Interfaces Course evaluation
Repetition and practice
Intro to Graphical User Interfaces
Graphical User Interfaces
14 2025-01-31 Summary & Outlook Course evaluation results
Surprise
Summary & Outlook

2 Last session: Git(Hub) with the world

Last session: Git(Hub) with the world

https://github.com/lnnrtwttkhn/city-guide/pulls

Last session’s learning objectives

GitHub Advanced

💡 You know the purpose and components of a Pull Request.
💡 You know how to collaborate using the popular workflow strategy GitHub flow.
💡 You know the purpose and components of a README file.
💡 You can fork a repository.
💡 You can create a Pull Request from a forked repository.
💡 You can protect your main branch.

Issues

💡 You understand the purpose of GitHub Issues.
💡 You can create and manage Issues.
💡 You can reference an Issue in another issue.
💡 You can close an Issue with a commit or pull request.

Questions about the last session?

3 This session: Tags, Releases & Publication

Tags, Releases & Publication

4 Tags & Releases: Examples

Example 1: MATLAB code for an experimental task in research

https://github.com/lnnrtwttkhn/highspeed-task

See Code Availability Statement of paper:

All code to run the behavioral task can be found at (https://github.com/lnnrtwttkhn/highspeed-task; https://doi.org/10.5281/zenodo.4305888)

Advantages

  1. Reusability: Code is on GitHub and can be forked, reviewed, reused, extended, etc.
  2. Reproducibility: The specific version that was used in the original study is tagged.
  3. Modularity: Other researchers can independently reuse only the code for the experimental task.
  4. Backup: Code can be accessedd in at least two locations.
  5. Independence: If GitHub disappears, a copy of the code is still on Zenodo.
  6. Recognition: Other researchers can cite the code + views and downloads metrics on Zenodo.

Example 2: Code releases in software development

https://github.com/lnnrtwttkhn/version-control-book/releases/tag/v1.0

Advantages (non-exhaustive list)

  • Automated Change Log based on PR titles
  • Automated appreciation of new contributors

This session’s learning objectives

💡 You understand why Git Tags matter in version control and project management.
💡 You know the difference between lightweight and annotated tags and how to apply them.
💡 You can push and pull tags to a remote repository (e.g., GitHub).
💡 You understand how GitHub releases complement Git Tags.
💡 You can use Zenodo to archive your repository and make your work citable.

Reading

“Tags & Releases”

Tasks

In this session, you will work on the following tasks:

  1. Reading: Read the chapter(s) “Tags & Releases” in the Version Control Book.
  2. Implementation: Try out the commands in the chapter.
  3. Exercises: Work on the exercises for the city-guide project.
  4. Quiz: Test your knowledge with the quiz.

As always:

  1. Try out the commands of this session and play around with them.
  2. Check whether you have achieved the learning objectives.
  3. Ask questions!
  4. Let’s git started!

city-guide project

At the end of this session, you should have accomplished the following:

  1. You created an annotated Tag and a GitHub Release.
  2. You linked the release to Zenodo’s sandbox and minted a DOI.

Please keep the city-guide folder! We will continue to use it in the following sessions.

Exercises

Task 1: Create a Tag

  1. Preparation: Clean-up your repo, merge any changes that you still want to integrate
  2. Publish your repo: Go to “Settings”, click “General”, scroll down and change repository visibility
  3. Create an annotated tag on the main branch in your city-guide repo named v1.0.0.
  4. Push the Tag to GitHub
  1. Create a Zenodo account by visiting the Zenodo website and signing up.
  2. Link your GitHub account to Zenodo
  3. Go to the GitHub section in the Zenodo sandbox and enable syncing your city-guide repository

Task 2: Create a GitHub Release and mint a DOI

  1. Go to your repository on GitHub.
  2. Click on “Releases” then “Draft a new release”.
  3. Choose the tag v1.0.0 from the list
  4. Fill in the release title and description.
  5. Click “Publish release”.
  6. Go to the GitHub section in the Zenodo sandbox and look at your DOI

Solutions

Create a lightweight or an annotated tag named v1.0.0.

  1. For a lightweight tag:
git tag v1.0.0

For an annotated tag:

git tag -a v1.0.0 -m "Release version 1.0.0"
  1. Push the tag to GitHub:
git push origin v1.0.0

Create a GitHub Release

  1. Go to your repository on GitHub.
  2. Click on “Releases” then “Draft a new release”.
  3. Choose the tag v1.0.0 from the list
  4. Fill in the release title and description.
  5. Click “Publish release”.
  1. Connect your GitHub repository to Zenodo.
  • Go to Zenodo and log in.
  1. Follow Zenodo’s instructions to link your repository:
  1. Go to the “GitHub” tab in your Zenodo settings. Navigate to Settings in Zenodo. Click on the GitHub tab.

  2. Enable the repository for Zenodo integration. Find your GitHub repository in the list and toggle the switch to enable it for Zenodo integration.

  1. Create a new release on GitHub to trigger Zenodo to archive your repository and mint a DOI.
  • Go back to GitHub and create a new release (as described in the Create a GitHub Release section). This will trigger Zenodo to archive your repository and mint a DOI for the release.

Next week: Practice with GUIs (+ course evaluation!)

… following popular request

Integrated Development Environments (IDEs)

RStudio

MATLAB

Git Clients

GitKraken

GitHub Desktop

Mobile

Working Copy (iOS)

Homework

  1. Sign-up for GitHub Education to get access to the Student Developer Pack
  2. Install GitKraken and sign-up with your GitHub account
  3. 🚀 Optional: Check out other Git GUIs that you’d like to try (e.g., RStudio)

5 Course requirements

From session 1: Your role

Active participation

  • This is a pass / fail course. You pass if you fulfill all course requirements:
  • Requirement 1: Come to at least 12 out of 14 sessions (85%)
  • Requirement 2: Complete all surveys/quizzes
  • Requirement 3: Complete all mandatory exercises (implemented in Git)

How do we verify the course requirements?

  1. Requirement 1: Sign the attendance list
  2. Requirement 2: Provide a personal codeword. At the end of the semester, send an email with your personal codeword to sekretariat-luv.psych@uni-hamburg.de (Christine Manor). We will send our secretary a list of personal codewords and she will return a list of names.
  3. Requirement 3: We check your GitHub repositories.

Your tasks

In order to pass this course, you should have accomplished the following tasks:

  1. You have a public city-guide repository on GitHub (Sessions 03, 08, 12).
  2. You added a text file (e.g., .qmd or .txt) with at least one city recommendation to the repository (Session 03).
  3. You added a .gitignore file (ignoring a random file like an image) to the repository (Sessions 04, 05).
  4. You created and merged a branch in your repository (Session 06).
  5. You created a pull request in a partner’s repository, e.g., by adding a new recommendation (Sessions 09, 10).
  6. You reviewed and merged the pull request of a partner in your city-guide repository (Sessions 09, 10).
  7. You created an issue in Lennart’s city-guide repository, a pull request from a fork fixing the issue, you implemented all additional requests and your pull request was approved and merged by Lennart (Session 11).
  8. You created a release of your city-guide repository on GitHub (Session 12).
  9. You completed all quizzes (see next slide).
  10. You completed the extra assignment (if necessary, see next slide).

Quiz participation

In order to pass this course, you should have completed all quizzes:

  1. Intro
  2. Command Line
  3. Git Basics
  4. Branches
  5. GitHub

How to verify participation

  1. At the end of the semester, send an email with your personal codeword to sekretariat-luv.psych@uni-hamburg.de (Christine Manor), not to us!
  2. Our secretary sends us an unsorted list with codewords.
  3. We verify the quiz participation for each codeword and send Christine a list with codewords that completed all quizzes.
  4. Christine compares the codewords with your names and send us an unsorted list with names.

Missed more than two sessions?

We will send you an email with an extra assignment.