Session 11: Git(Hub) with the world

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 10 2025 (10:15 am)

1 Schedule

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: GitHub - Collaboration

Last session: GitHub - Collaboration

https://lennartwittkuhn.com/version-control-book/chapters/github-advanced.html

Last session’s learning objectives

💡 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.

Reminders / FAQ

“Remember to cd in your city-guide project folder!”

  • Every time you open the command line, it starts at a default location (likely your home directory).
  • Check in which folder you are, using pwd (“print working directory”).
  • Use cd to move to your city-guide project folder before you start running the Git commands.

“Remember to clone your collaborator’s repository to a different location (not into your city-guide project folder!)”

  • cd out of your city-guide project folder
  • Clone into a different folder git clone git@github.com:partner-name/repo-name.git city-guide-partner

More questions about the last session?

3 This session: Git(Hub) with the world

Git(Hub) with the world

Image from Techdobz

New topic: Issues

Link to Issue

Issues in Lennart’s recipes repository

Link to Issue

This 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.

Reading

“GitHub - Advanced” and “Issues”

Start at the section on “Forking”.

Tasks

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

  1. Reading: Read the chapter(s) “GitHub - Advanced” and “Issues” 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!

Lennart’s city-guide repo

https://lennartwittkuhn.com/city-guide/

city-guide project

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

  1. You contributed successfully to a public project by adding and committing changes to a forked repository.
  2. You created and reviewed a pull request to integrate new content from a fork.

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

Today’s (team) topic

  • Think about your top recommendation for the city guide.
  • Add your top recommendation to the forked repository.
  • Help each other in completing the exercises.

Exercises

“Public” collaboration with pull requests (using a fork and GitHub Flow)

  1. Find out what forking is.
  2. Fork the project repository of the course instructor or another course participant (ideally, someone who is not your collaborator from the previous exercise).
  3. Create an Issue in your new collaborator’s repository, indicating an entry that you think is still missing in their repository.
  4. Repeat the steps from the exercise on collaboration with remote repositories using the forked repository:
    1. Clone the forked repository to a sensible location on your computer.
    2. Create a new branch and make one or multiple commits “fixing” the Issue that you opened. If available, follow the contributing guide of your collaborator’s repository.
    3. Push your changes to the remote repository.
    4. Create a pull/merge request with your changes (hint: from the forked to the original repository) and refer to the Issue in your pull/merge request.

4 Live demonstration

Oh, another issue!

Link to Issue