Details
SoMe Post
Are you teaching Git?
Come to our Open House session on Tuesday Jan 14 and discuss with few people who
are interested in how a lesson could look like which goes beyond basic Git.
Let's share materials, find the gaps in the curriculums and collaborate to fill these gaps.
Connection details and agenda: https://hackmd.io/@coderefinery/oh_git_masterclass
Open House agenda
- Welcome
- Introductions
- Share materials links, fill list of topics, until xx:35
- Experience exchange in groups of 3 until xx:55
- Same as above with new group until xx:15
- break until xx:26
- Some more introductions
- Keyword collection and where they are discussed until xx:57 and xx:25
- Rooms based on rough topics
- Recovery
- History
- User interfaces
- Project organization
- Collaborative workflows
- Combining changes
- Under the hood of git
- Breaka and voting until xx:35
- Identifying gaps
Create lesson structure/plan/design
- Future meetings/work
Introductions
- Name
- Affiliation/ home base
- e-mail (if wished)
- "my life with git"
- do you teach git?
- my goal for today / why I am here
- availability for continuing the work
Samantha Wittke
- CSC/CodeRefinery Espoo/Lohja, FI (samantha.wittke@csc.fi)
- everyday basic user, nowadays less for code and more for other work: docs, presentations, project work
- sometimes showing basics of git to colleagues
- goal: awareness and knowledge exchange, starting the discussion, hosting/facilitation
- available for supporting continued work
…
- Neil Shephard
- Research Software Engineer, University of Sheffield
- n.shephard@sheffield.ac.uk
- daily user of Git, mainly via Emacs amazing Magit porcelain. Big fan of pre-commit. Used across a number of work and personal projects for code development leveraging CI to publish to PyPI, make presentations and maintain blog. Self host my own instance of ForgeJo and OpenGists as mirrors.
- Been teaching basic Git using material developed by a colleague Git and GitHub through GitKraken : From Zero to Hero and have been developng my own intermediate course Git Collaboration which will be delivered for the first time in February.
- Interested to see what others are doing an how we can work together and reduce duplicated efforts.
- Would like to be involved, can probably spare a couple of hours each week.
- Marc-André Hermanns
- IT Center, RWTH Aachen University, Germany
- hermanns@itc.rwth-aachen.de
- Moved from Subversion/Trac to Git/Gitlab for managing our research software, and used for many more use cases since
- Not yet teaching git, but plan to (in context of Carpentries and HPC.NRW)
- Connect with other instructors and setting up a collaborative effort for Git material of all levels (including expert-level)
- Availability for continuing the work depends on alignment of work with goals of funding projects
- Christian Knüpfer
- Competence Center Difgital Research, University Jena, Germany
- christian.knuepfer@uni-jena.de
- daily work with Git and GitLab
- I'm giving beginners and advanced Git courses
- see what is out there; improvement of our advanced Git course
- I'm interested to join efforts
…
- Jonathan Hartman
- IT Center, RWTH Aachen University, Germany
- hartman@itc.rwth-aachen.de
- working with git daily for various projects, teaching others how to use git
- I do sporadically, 1on1 typically (introductory material)
- see in what ways we can add to the exiting material / what might be missing
- I would be interested
- Diana Iusan
- application expert (UPPMAX, NAISS, Sweden)
- diana.iusan@uppmax.uu.se
- using Git several times per week
- I have been teaching Git during some of the CodeRefinery workshops, also in a 5 half-days course (UPPMAX-HPC2N collaboration)
- here in order to take the CR Git lesson to a more advanced level
- available to work on the lesson
- Lukas C. Bossert
- IT Center, RWTH Aachen University, Germany
- bossert@itc.rwth-aachen.de
- "my life with git"
- … is done using magit, but still do "just" the basic commands
- do you teach git?
-
- Yes, Software Carpentries course
- my goal for today / why I am here
- I think there is definetely a need for an advanced course especially when it comes to certain features platforms offer (CI/CD)
- availability for continuing the work
- sure, write an email, not sure if I can continously contribute on a regular base
Radovan Bast
- Uit the Arctic University of Norway, Tromso and NeIC/CodeRefinery
- radovan.bast@uit.no
- "my life with git": started in 2008 and using it every day
- do you teach git?
- yes! and really enjoying to. mostly teaching it in the CodeRefinery context but also teaching to my colleagues in other projects/organizations and also giving tailored courses to research groups
- my goal for today / why I am here
- that we all know about materials that we already have
- if we decide to develop some new material, we ideally don't re-invent the same things in isolation but perhaps collaborate/share
- availability for continuing the work
The CodeRefinery project: https://coderefinery.org/
-> Community hanging out at: https://coderefinery.zulipchat.com/
Joe Marsh Rossney
- RSE @ UK Centre for Ecology & Hydrology (Edinburgh) joemar@ceh.ac.uk
- We are a new RSE group, about to start a basic git course, so this is me looking ahead on behalf of our group to what a sensible next step would look like
- Aim for today: gather some initial thoughts and ideas, make connections - know where to look when the time comes!
- I use git+GitHub daily for code and personal notes, but open to GitHub alternatives
Michele Mesiti
- RSE@ Karlsruher Institute für Technologie, Karlsruhe (Germany) michele.mesiti@kit.edu
- I (mis) use Git every day, mostly from the command line but also from Magit in Emacs for some things (depends on what is most convenient).
- I have taught Git within Software Carpentry workshops, but then the audience I was teaching to has changed to more intermediate people (partially), so I have tried adding some more advanced material. I have tried to teach a 3-hour workshop aimed at intermediates, but it has not worked out well (already reported on it elsewhere)
- My goal for today: share what I think failed in our intermediate workshop, discuss a list of topic and their justifications (backward lesson design), and some philosophical questions about this in particular
Richard Darst
- RSE, Aalto University, Finland
- Use git every day, read a lot about it, have lots of obscure aliases - basically, the way I use it isn't how it should be taught. I wrote something called git-pr to shorten things even more.
- I teach via coderefinery
- Goal is mainly listen and I hope for a more advanced course+reference after coderefinery (maybe something to inspire people)
- Probably little time to prepare and teach but I would be interested.
Dominic Kempf
- Scientific Software Center, Heidelberg University, Germany
- dominic.kempf@iwr.uni-heidelberg.de
- I use git daily for RSE development work, project management and self-organization
- I teach Git in Carpentry-style courses within Heidelberg University:
- Beginners taken from SWC without much adaptation
- Intermediate Git
- Expert Git
- Links to the materials of my courses are already up there in the material collection
- My goal for today: One of my plans for 2025 is to contribute some of my teaching materials to a community-based effort. We started with this at the CarpentryConnect hackathon, it would be great to continue this and find more allies for it.
Jannetta Steyn
- Senior Research Software Engineer, Head of Training and Community, Newcastle University
- jannetta.steyn@newcastle.ac.uk
- I use git daily for just about everything, project management, development, self-organisation …
- I teach (mostly) Software Carpentries workshops, (mostly) within Newcastle University
- I am here because anything that could help me in my teaching and development of further learning materials is of interest to me
- I could be available, especially if the activities helps me with delivering training at university.
Nishka Dasgupta (ND)
- Danmarks Meteorologiske Institut
- nid@dmi.dk
- I use git in all my projects, whether working in a group or alone
- I have taught a "Beginners' git" course 3 times at my organization and will be teaching more intermediate/advanced courses going forward
- I want to learn how to teach more effectively, especially to people who are not approaching this from an IT background
- I am interested
- Dimitrios Theodorakis
- Met Office
- d.theodorakis@metoffice.gov.uk
- I use Git daily
- Yes as part of a custom carpentries lesson
- Meet other people teaching Git
- Depends on what work prople decide needs doing!
Goal for today
- Share experiences and materials
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Find gaps and overlaps
- Collect goals and see what we can do togther to not reinvent the wheel
- RB: that we all know about materials that we already have; if we decide to develop some new material, we ideally don't re-invent the same things in
- SW: awareness and knowledge exchange, starting the discussion
- JMR: gather some initial thoughts and ideas, make connections - know where to look when the time comes!
- LCB: I think there is definetely a need for an advanced course especially when it comes to certain features
- IM: Share experiences, contribute to discussion, find contributors to the curriculum above?
- DI: here in order to take the CR Git lesson to a more advanced level
- JH: see in what ways we can add to the exiting material / what might be missing
- CK: see what is out there; improvement of our advanced Git course
- MAH: see in what ways we can add to the exiting material / what might be missing
- MM: share what I think failed in our intermediate workshop, discuss a list of topic and their justifications (backward lesson design), and some philosophical questions about this in particular
- RD: mainly listen and I hope for a more advanced course+reference after coderefinery (maybe something to inspire people)
- NS: discover existing materials and work towards collating these into a single open, community maintained material. Refine what is
- DK: Identify plans and allies to contribute my materials to a community-based effort
- ND: I want to learn how to teach more effectively, especially to people who are not approaching this from an IT background
Materials out there
Add your materials on basic/advanced/expert git here:
Advanced git in Carpentries incubator (pre-alpha) (Ivelina)
Other Incubator projects on intermediate and advanced git
Git - beyond the basics
Heidelberg University material for intermediate/expert git courses (Dominic)
e-Science Center
Collaborative version control with Git and GitHub
Code Refinery
Git and GitHub through GitKraken : From Zero to Hero
University of Sheffield - Git Collaboration
KIT - Intermediate git
Mostly CodeRefinery material, but with some additions:
zedif Jena - Collaborative Version Control with Git: An Advanced Workshop
Basic GitHub but including pull requests and branching
Met Office Resources - Custom Software Carpentry Lessons
Other resources:
Topic collection/mapping
Based on: https://coderefinery.zulipchat.com/#narrow/channel/136238-lessons/topic/git.20and.20github.20.22masterclass.22
What we will do with the list below:
-> add missing topics and don't hesitate to re-group/re-order
-> Discuss the topics under the bold headers, everything covered, something too much? Add links to materials where these topics are already discusses
-> identify overlaps and gaps
-> prioritization by voting
Recovering from local mistakes
- Creating a mental model for commits and branches that allows learners to understand how different commands move along the tree and convey principles / some more theoretical understanding of how git actually works, to give some explanation for (e.g.) how to undo things | +5
- Using the reflog to recover from bad resets | +2
- Recovering from making commits to the wrong branch | +4
- Undoing/partially doing add (command-line or GUI-assisted) | +3
- Editing a previous commit (log, splitting, reverting) | +3
- Available material which covers multiple of the above:
- extend material on remotes | +x
More phylosophical/general:
"how to undo things". In most basic courses, we do not teach how to undo operations on the git repository, how those operations compose and what is the limit on composability. e.g.: You committed to the wrong branch, how do you "undo", or fix that? In general, you did X, how do you rewind if you change your mind? (Git is not very flexible in this regard, and it's a meta-level problem so it is not crucial for beginners)
History (Neil and Dominic)
Changing history
- How to modify an open pull request/ merge request - responding to code review with changes (rebase, squash, edit commits) | +8
- Make additional commits so that reviewers can see changes, no examples in material that we are aware of.
- How to remove something from the history | +8
- Start with
git revert
and how it doesn't actually remove from hisotry. Removing from history completely can be done using BFG-repo-cleaner.
- Interactive rebase to squash/delete/re-order commits | +12
- Gradually introduce rebase: Amending/Fixup first, then interactive rebase. Do not overwhelm with full power, links into creating clearer history while working. | +x
- XKCD comic as motivation to git rebase. This repository implements the git history of that comic and fixes it: https://github.com/ssciwr/git-rebase-xkcd-example (Details in Dominics material)
- Squashing commits into a logical unit using reset | +x
Creating clearer history while working
- Partial staging and committing | +3
- Pulling with rebase | +3
- Rebasing across conflicts | +11
- First should cover the two ways of updating branches, either
git merge
or git rebase
and explain why and when you might prefer one of the other. Both can result in conflicts though!
- Then go on to explain how to resolve conflicts.
- Some of this is covered in the Diverging branches chapter
- Temporary work and stashing | +7
- Small episode in Dominics material
- Atomic commits, using
git commit --amend
and git commit --fixup
which provide a gentle introduction to git rebase -i
(see above) | +3
History inspection
- Which branches and commit have you worked on? (Analysing/Debugging history - Meta Level) | +x
- Searching through code changes with "pickaxe" | +x
- Finding a commit that introduced a bug with git annotate or bisect | +2
Collaborative workflows
- Underscore the importance of having a workflow: contributing changes is key for reproducibility, many users fork a project and change it and then just use their own version. Also trains useful transferable skills to industry/research software engineering. | +2
-
-
-
- Git project guidelines, i.e., no merge requrest without an issue, only a limited number of people merge to master, etc. A collection of the most important guidelines, familiarize participants with different options. | +2
- Forking workflow | +x
- GitFlow, different variations, with or without a development branch, feature branches, hotfixes | +x
- Working with PR/MRs and code reviews | +2
- Organizing commit history for keeping code reviewers' sanity | +x
- Stacked Branches Workflow | +x
- Code review | +x
Organizing projects
Suggestion: this topic belongs on a 'RSE/Data Manager track' of git training, separate from a 'researcher/user track' that focuses more on daily usage, recipes etc - 'history' & 'recovering' sections.
- Nesting repositories with git submodules | +3
- Tracking large files with git-lfs/ git-annex / https://dvc.org/ | +2
- Partial cloning for huge repositories | +x
- Making & distributing template repositories
Best practices:
- How to write a 'proper' git commit message | +1
- What to do when you have hundreds or thousands of repositories in various states of completion/abandonment, e.g. using GitHub's labels and/or other features (this could be a "best practice" section how to organize your repository, but it is (maybe) not specific a git topic)
- Naming conventions
- These could be served by e.g. blog posts disseminated via community forums, probably don't need to be part of a formal course
Resources:
- For keeping track on multiple repositories / places using DataLad could be a solution (based on git-annex)
- CleanCode as setting a base for the (code in the) repository
User interfaces and experience
- Nice life hacks in
.gitconfig
| +4
includeIf
to have custom configuration based on directory path.
- using
aliases
conflictstyle = diff3
under [merge]
to not only see a conflict but also what the original code was when resolving
defaultBranch = main
pushDefault = origin
- Aliases to avoid long complicated commands
- how to not reveal your email address if you prefer to not reveal it
- Using GitHub/GitLab command line utilities (PRs from command lines) | +1
- Collaborate between Windows users and *nix users (line ending issue) | +x
- git hooks | +2
- pre-commit, some blog posts on this can be found here and there is a chapter on this in here
- GitHub actions / GitLab CI/CD | +2
- running GHA locally: act
- ssh-ing into failed job runners using tmate and debug the issue on GitHub
- Git shell prompts | +3
- Oh-my-zsh (default on OSX) provides nice Git prompts via themes.
- how to customize fish shell for Git
- how to use GUI for line-based "git add -p" commands, difftool, mergetool | +2
- excellent tool for diffing and integrates easily with Git (see git configuration)
- delta - syntax-highlighting pager that can be customized
- meld as difftool/mergetool
- Signing commits can be a pain point as GPG is a bit of a pain to use in and of itself.
- Can sign with SSH keys these days.
- How to some ignore files globally for all your repos (these are typically ignore patterns that relate to individual settings rather than ignore paths that would be useful for all)
Combining changes
- More advanced merge situations | +2
- Rebasing | +2
- Cherry-picking to apply change from a single commit (alternatives to merge) | +2
How git works under the hood
Working with remotes
- extend material on remotes | +x
- this could be combined under "recovery" and there under the discussion of how to teach a mental model for Git; we had quite a bit of discussion on this during first breakout room discussion
Other notes from discussions
-
should one move from basic to intermediate immediately as learner? Maybe better to say: "use this for few months and let's look then"?
-
someone tried to teach merge conflicts with tic-tac-toe game where you don't see the other person's move until you merge and then who resolves first has a game advantage
-
how to keep thins small and manageable
-
what is the typical first big step/blocker/problem that learners meet when they start with Git?
- once the second collaborator enters
- mental model
- too large commits
- what is happening locally, what is happening remotely
- merge conflicts
- recovering from typical mistakes
-
does intermediate git typically happen on the command line?
- some line-based operations (partial staging, comparisons), GUIs can be more convenient
- good commit messages, how to motivate why it is useful to have useful commit log
- large out-of date branches, problems later when merging
- revert vs. reset
-
could we show that we can recover from almost everything to reduce fear to experiment?
-
did you introduce yourself to git or did you have someone you could ask who knew more at the time you started?
-
show how git works "under the hood"
-
how to modify your (git) prompt (or just state that you can)
-
section with "best practices" on how to to do certain things on the CLI
-
How best to chain together a sequence of pull requests, where each one builds on the previous one, or whether this is a good idea at all (especially if working on a fork)
-
Are learners comfortable on the command line? For some, a git workshop may be the first time they see the commmand line. Learners can be heterogenious. Hard to have precise pre-requisites. Code Refinery has examples on using VSCode or the command line. Potentially using Git Desktop.
-
Stand alone Git clients not tied to an IDE are an option Git Kraken is one Git Butler another. Depending on the user community there may be different preferred tools, VSCode, RStudio, Emacs's Magit. Using the command line allows users to learn a universal way to use Git and the associated principles and then apply it to their own development environment. People are sometimes afraid of the command line but some of these lessons are good introductions to the command line. It would be useful to have introduction to basic Bash Shell/Unix as a pre-requisite to undertaking advanced Git course if command line is to be used.
-
Depends on how much people want to learn. For beginners they just want to get things done and working in GitHub is enough.
-
Some tools don't have all the functionality too, so it limits what you can do.
-
Idea: asynchronous collaborative 'mini-project' as part of the course, so that people can (a) cement ideas by actually putting them into practice immediately, (b) cover some workflows and practices (e.g. code review) that are less suitable for formal instruction but still important to familiarise ones self with.
-
idea: Helper exchange: Help out at other peoples workshop; how to organize?
Comment: Different communities have different usecases which may require slightly different lessons, would be great to have some way of providing choose your own adventure type of modular lessons
Comment: As platform, we should look at sustainability.
Gaps identified
- Partial adding
- Stashing (in CR materials, but often not covered in workshop)
- remote repositories
- tags
- hooks and actions (?)
- customize user experience (shell, config, GUI tools, …) "life hacks"
- …
Follow up
- Where to go from here?
- blog post on CodeRefinery as first summary
- further meetings (add your e-mail address to your introduction or send an e-mail with your interest to samantha.wittke@csc.fi)
- Actionpoints with names
- Summary/blogpost writing: SW (add your initials or contact email if you want to help
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
, I'll reach out)
- Invite next meeting: SW, DI, ND, MM, MAH, JS, IM, JMR, DK
- Topic: Looking into the future: What lessons are missing, where do we put them and how do we collaborate
Carpentry call 27.01 on Teaching Git @ MetOffice:
Lesson structure
- Lesson Name:
- Homebase (for now):
- Prerequisites
- Learner personas?
- Learning objectives?
- Engaging exercise ideas
3D Print your GitHub activity

