diff --git a/beyond/Exercise_4_cherry-pick-rebase.md b/beyond/Exercise_4_cherry-pick-rebase.md index 11dea95..ddd26c2 100644 --- a/beyond/Exercise_4_cherry-pick-rebase.md +++ b/beyond/Exercise_4_cherry-pick-rebase.md @@ -6,7 +6,7 @@ Both commands take commits that exist in one place and replay them somewhere else. `git cherry-pick` moves **one** commit; `git rebase` moves **a whole branch**. Both create new -commits with new IDs, which is what makes them powerful and what makes them dangerous. +commits with new IDs, which is what makes them powerful, but also dangerous. In this exercise you use cherry-pick to rescue a single commit from a branch, then compare merging and rebasing on the same starting point so you can see the difference in the history. @@ -139,8 +139,8 @@ whole difference from `git merge`, which would bring the entire branch. > [!WARNING] -> Because the cherry-picked commit has a **new ID**, you should not later merge `cherry_feature` -> into `main`: the same change would arrive a second time, and depending on the content you may +> Because the cherry-picked commit has a **new ID**, you should not merge `cherry_feature` +> into `main` later on: the same change would arrive a second time, and depending on the content you may > get a conflict for a change that is already there. > > Cherry-pick is for salvaging work from a branch you are **abandoning**. If the branch is still diff --git a/beyond/Exercise_6_hooks.md b/beyond/Exercise_6_hooks.md index 92fd7f0..e5c7ee6 100644 --- a/beyond/Exercise_6_hooks.md +++ b/beyond/Exercise_6_hooks.md @@ -212,8 +212,8 @@ set -e -**Task 10.** Add a second check of your own as *.git/hooks/pre-commit-nonempty*: reject a commit -whose message would be empty, or write something else useful. Wire it into the dispatcher and +**Task 10.** Add a second check of your own as *.git/hooks/pre-commit-large-files*: reject committing +a large file, or write something else useful. Wire it into the dispatcher and verify both checks run.
๐Ÿ’ก Hint @@ -246,7 +246,7 @@ for file in $(git diff --cached --name-only --diff-filter=ACM); do done ``` -Then add `.git/hooks/pre-commit-nonempty` to the dispatcher and `chmod +x` it. +Then add `.git/hooks/pre-commit-large-files` to the dispatcher and `chmod +x` it.
diff --git a/beyond/Exercise_7_git-lfs.md b/beyond/Exercise_7_git-lfs.md index 466d04c..a27ad51 100644 --- a/beyond/Exercise_7_git-lfs.md +++ b/beyond/Exercise_7_git-lfs.md @@ -137,7 +137,7 @@ ls -lh model_output.nc **Task 6.** Add and commit it. > [!NOTE] -> If you kept the large-file check from [Exercise 6](Exercise_6_hooks.md#several), this commit is +> If you kept the large-files check from [Exercise 6](Exercise_6_hooks.md#several), this commit is > rejected. That hook reads the file straight off disk with `wc -c`, so it sees the real 2 MB > regardless of what LFS is about to store. The check is asking the wrong question here: not "how > big is this file" but "how big is what Git will actually commit." Skip it for this one commit diff --git a/beyond/Exercise_8_web-workflow.md b/beyond/Exercise_8_web-workflow.md index 39cad37..224e771 100644 --- a/beyond/Exercise_8_web-workflow.md +++ b/beyond/Exercise_8_web-workflow.md @@ -1,4 +1,4 @@ -# Exercise 8 - A full workflow in the web interface +# Exercise 8 - A full workflow in GitHub > [!NOTE] > **โฑ๏ธ Estimated working time:** 30-40 minutes @@ -30,7 +30,6 @@ In this exercise we cover the following: - [6. Respond to your own review and merge](#merge) - [7. Keep your fork in sync](#sync) - [8. Handle a conflict](#conflict) -- [GitHub and GitLab](#gitlab) ## 1. Open an issue @@ -348,23 +347,6 @@ The pull request updates itself and the conflict warning disappears. If conflict markers are unfamiliar, the beginner course covers them in detail: [Exercise 6 - Merge conflicts](../beginner/Exercise_6_merge_conflicts.md). -## GitHub and GitLab - -C2SM works on both `github.com` and `gitlab.ethz.ch`. Everything you just did transfers; only the -names and the CI file change. **The local Git commands are identical.** - -| Concept | GitHub | GitLab | -| --- | --- | --- | -| Proposed change | Pull request (PR) | **Merge request (MR)** | -| Close an issue automatically | `Fixes #12` / `Closes #12` | `Closes #12` | -| CI configuration | `.github/workflows/*.yml` | **`.gitlab-ci.yml`** | -| Sign-off on a change | Approve / request changes | **Approvals**, a required count | -| Static site hosting | GitHub Pages | GitLab Pages | -| Preview of a change | PR preview via an Action | Review Apps | -| Ownership rules | `CODEOWNERS` | `CODEOWNERS` | -| Update a fork | "Sync fork" button or `upstream` remote | `upstream` remote | -| Namespaces | User / organization | User / **group**, nestable | - ## Check yourself - [ ] Why start with an issue rather than going straight to a branch? diff --git a/beyond/schedule.md b/beyond/schedule.md index 34b5fd9..4f1f355 100644 --- a/beyond/schedule.md +++ b/beyond/schedule.md @@ -1,36 +1,76 @@ # Schedule -3/4-day course, 09:30 โ€“ 15:00, lunch break 12:30 โ€“ 13:30. - -> Notes: -> - 2026: restructured from Parts 0-4 + Bonus into two parts (commands, then web workflow). -> - 2026: `git bisect` dropped, `git lfs` added; rebase promoted from bonus into Exercise 4. -> - 2026: exercises rewritten as tasks with optional hints, so they take longer to work through -> than the old copy-paste versions. Watch the timing on Exercises 1 and 4 in particular. -> - 2026: start moved 15 min earlier to 09:15 (end time 15:00 stays fixed), welcome trimmed from -> 10 to 5 min, and the three exercise blocks were extended to absorb the longer task-based -> format. This still falls short of the exercises' own printed time estimates, so Exercises 1, -> 2, 4 and 5 have some of their tasks marked as Bonus (optional, skip if short on time). -> - 2026: the coffee break sits right after Exercise 3, matching the slide deck order (the -> `.gitignore` slides and Exercise 3 come before the break, cherry-pick/rebase/stash/worktree -> after it). The former single "Exercises 3-5" row is split at that point; the '24/'25 timing -> data was only recorded for the combined block, so it doesn't carry over to the split rows. - -| Description | Presenter | Extent | Time est. | Time needed ('24, '25, '26) | Start time | End time | +3/4-day course, 09:15 โ€“ 15:00, lunch break 12:30 โ€“ 13:30. + +## 2026 + +The 2026 edition was restructured, so the older timing data no longer maps onto it (see +[Previous years](#previous-years) for the '23-'25 records and +[What changed in 2026](#what-changed-in-2026) for the reasons). + +Slide blocks and exercise blocks are listed separately, so that theory and hands-on time can be +budgeted independently. The **Exercise est.** column repeats the working time printed in each +exercise file: *core tasks* first, *bonus tasks* in brackets. Where the budget is below the core +estimate, the block is expected to be tight - keep an eye on the clock and let the bonus tasks go. + +| # | Description | Presenter | Slides | Budget | Exercise est. | Start | End | +| --- | --- | --- | --- | --- | --- | --- | --- | +| | Welcome, outline, schedule | Micha | 1-3 | 5 min | | 09:15 | 09:20 | +| | **Part 1 ยท Slides:** recap, examining history | Ali | 4-8 | 15 min | | 09:20 | 09:35 | +| 1 | **Part 1 ยท Exercise:** examining history ๐Ÿ’ป | | 9 | 20 min | 20-25 min (+10-15) | 09:35 | 09:55 | +| | **Part 1 ยท Slides:** submodules | Ali | 10-13 | 10 min | | 09:55 | 10:05 | +| 2 | **Part 1 ยท Exercise:** submodules ๐Ÿ’ป | | 14 | 15 min | 15-18 min (+5-7) | 10:05 | 10:20 | +| | **Part 1 ยท Slides:** ignoring files | Ali | 15-17 | 5 min | | 10:20 | 10:25 | +| 3 | **Part 1 ยท Exercise:** ignoring files ๐Ÿ’ป | | 18 | 15 min | 10-15 min | 10:25 | 10:40 | +| | Coffee break | all | 19 | 20 min | | 10:40 | 11:00 | +| | **Part 1 ยท Slides:** cherry-pick, rebase | Mikael | 20-21 | 10 min | | 11:00 | 11:10 | +| 4 | **Part 1 ยท Exercise:** cherry-pick, rebase ๐Ÿ’ป | | 22 | 25 min | 22-26 min (+3-4) | 11:10 | 11:35 | +| | **Part 1 ยท Slides:** stash, worktree | Mikael | 23-24 | 5 min | | 11:35 | 11:40 | +| 5 | **Part 1 ยท Exercise:** stash, worktree ๐Ÿ’ป | | 25 | 15 min | 12-15 min (+4-6) | 11:40 | 11:55 | +| | **Part 1 ยท Slides:** hooks | Mikael | 26-27 | 5 min | | 11:55 | 12:00 | +| 6 | **Part 1 ยท Exercise:** hooks ๐Ÿ’ป | | 28 | 15 min | 15-20 min | 12:00 | 12:15 | +| | **Part 1 ยท Slides:** large files (`git lfs`) | Mikael | 29-30 | 5 min | | 12:15 | 12:20 | +| 7 | **Part 1 ยท Exercise:** `git lfs` ๐Ÿ’ป | | 31 | 10 min | 10-15 min | 12:20 | 12:30 | +| | Lunch break | all | 32 | 60 min | | 12:30 | 13:30 | +| | **Part 2 ยท Slides:** web workflow + live demonstration | Micha | 33-43 | 45 min | | 13:30 | 14:15 | +| 8 | **Part 2 ยท Exercise:** full web workflow ๐Ÿ’ป | | 44 | 40 min | 30-40 min | 14:15 | 14:55 | +| | Wrap-up: tools, references, questions | Micha | 45-48 | 5 min | | 14:55 | 15:00 | + +Totals: 115 min of slides and demonstration, 150 min of exercises, 80 min of breaks. + +### What changed in 2026 + +- Restructured from Parts 0-4 plus a bonus section into two parts: the commands first, then the + web workflow. +- `git bisect` dropped, `git lfs` added; rebase promoted from the bonus section into Exercise 4. +- Exercises rewritten as tasks with optional hints and solutions instead of copy-paste command + lists. They therefore take noticeably longer than the previous versions. +- Start moved 15 min earlier, to 09:15 (the 15:00 end time stays fixed), and the welcome trimmed + from 10 to 5 min, to create room for the longer exercises. +- The budget still falls short of the exercises' own printed estimates, so Exercises 1, 2, 4 and + 5 have some tasks marked as **Bonus** (optional, to be skipped when time is short). +- The coffee break sits directly after Exercise 3, matching the slide deck order: the + `.gitignore` slides and Exercise 3 come before the break, cherry-pick, rebase, stash and + worktree after it. + +## Previous years + +Recorded for the pre-2026 structure (Parts 0-4, 09:00 - 12:30, no lunch break). Kept for +reference only: the parts, the exercise numbering and the exercise format have all changed since, +so these numbers cannot be compared directly with the 2026 table above. + +| Description | Presenter | Extent | Time est. | Time needed ('23, '24, '25) | Start | End | | --- | --- | --- | --- | --- | --- | --- | -| Welcome, outline, schedule | Michael | 3 slides | 5 min | 8 min, 8 min, - | 09:15 | 09:20 | -| Part 1 - Slides: history, submodules | Michael | 9 slides | 20 min | -, -, - | 09:20 | 09:40 | -| Part 1 - Exercises 1-2 | ๐Ÿ’ป | | 40 min | 42 min, 42 min, - | 09:40 | 10:20 | -| Part 1 - Slides: ignoring files | Mikael | 3 slides | 10 min | -, -, - | 10:20 | 10:30 | -| Part 1 - Exercise 3 | ๐Ÿ’ป | | 20 min | -, -, - | 10:30 | 10:50 | -| Coffee break | all | 1 coffee | 20 min | 23 min, 20 min, - | 10:50 | 11:10 | -| Part 1 - Slides: cherry-pick, rebase, stash, worktree | Mikael | 6 slides | 10 min | -, -, - | 11:10 | 11:20 | -| Part 1 - Exercises 4-5 | ๐Ÿ’ป | | 25 min | -, -, - | 11:20 | 11:45 | -| Part 1 - Slides: hooks, git lfs | Alitzel | 6 slides | 10 min | -, -, - | 11:45 | 11:55 | -| Part 1 - Exercises 6-7 | ๐Ÿ’ป | | 35 min | 21 min, 21 min, - | 11:55 | 12:30 | -| Lunch break | all | | 60 min | | 12:30 | 13:30 | -| Part 2 - Slides + live demonstration | Michael | 12 slides | 60 min | 8 min, 8 min, - | 13:30 | 14:30 | -| Part 2 - Exercise 8 + wrap-up | ๐Ÿ’ป | | 30 min | -, -, - | 14:30 | 15:00 | +| Welcome, Part 0 & 1 | Annika | 10 slides | 10 min | 12 min, 8 min, 8 min | 09:00 | 09:10 | +| Part 1 - Exercises 1-2 | ๐Ÿ’ป | | 40 min | 34 min, 42 min, 42 min | 09:10 | 09:50 | +| Part 2 - Slides + demo | Mikael | 8 slides | 30 min | 20 min, 31 min, 30 min | 09:50 | 10:20 | +| Part 2 - Exercises 3-5 | ๐Ÿ’ป | | 40 min | 34 min, 29 min, 40 min | 10:20 | 11:00 | +| Coffee break | all | 1 coffee | 20 min | 17 min, 23 min, 20 min | 11:00 | 11:20 | +| Part 2 - Slides (cont.) | Mikael | 4 slides | 10 min | 4 min, 6 min, 13 min | 11:20 | 11:30 | +| Part 2 - Exercises 6-7 | ๐Ÿ’ป | | 20 min | 29 min, 21 min, 21 min | 11:30 | 11:50 | +| Part 3 - Slides | Mikael | 6 slides | 10 min | 4 min, 8 min, 8 min | 11:50 | 12:00 | +| Part 3 - Exercise 8 | ๐Ÿ’ป | | 20 min | 21 min, 16 min, 17 min | 12:00 | 12:20 | +| Part 4 - Slides | Annika | 3 slides | 10 min | 17 min, 18 min, 3 min | 12:20 | 12:30 | ## Notes for the next run diff --git a/beyond/slides/slides.md b/beyond/slides/slides.md index b092041..a78ef2d 100644 --- a/beyond/slides/slides.md +++ b/beyond/slides/slides.md @@ -78,17 +78,22 @@ You only need the **Git basics** for this course: `add`, `commit`, `push`, `pull --- + + # Schedule
09:15โ€“09:20
๐Ÿงพ Welcome and overview
-09:20โ€“10:50
๐Ÿงฐ History, submodules, ignoring files โ†’ Exercises 1 โ€“ 3
-10:50โ€“11:10
โ˜• Coffee break
-11:10โ€“11:45
๐Ÿงฐ Cherry-pick, rebase, stash, worktree โ†’ Exercises 4 โ€“ 5
-11:45โ€“12:30
๐Ÿงฐ Hooks and large files โ†’ Exercises 6 โ€“ 7
+09:20โ€“10:40
๐Ÿงฐ History, submodules, ignoring files โ†’ Exercises 1 โ€“ 3
+10:40โ€“11:00
โ˜• Coffee break
+11:00โ€“11:55
๐Ÿงฐ Cherry-pick, rebase, stash, worktree โ†’ Exercises 4 โ€“ 5
+11:55โ€“12:30
๐Ÿงฐ Hooks and large files โ†’ Exercises 6 โ€“ 7
12:30โ€“13:30
๐Ÿฝ๏ธ Lunch break
-13:30โ€“14:30
๐Ÿค Slides and live demonstration
-14:30โ€“15:00
๐Ÿค Exercise 8 and wrap-up
+13:30โ€“14:15
๐Ÿค Slides and live demonstration
+14:15โ€“14:55
๐Ÿค Exercise 8
+14:55โ€“15:00
๐Ÿงพ Wrap-up
--- @@ -966,14 +970,14 @@ The Git commands you already know do not change. What follows is a convention la --- @@ -986,7 +990,7 @@ The Git commands you already know do not change. What follows is a convention la - Documentation for models, tools, datasets and HPC systems used across C2SM - Written as plain Markdown, built into a website automatically -- Maintained by the core team, but **anyone in the group can contribute** +- Maintained by the core team, but **anyone can contribute** - Every pull request gets a **preview website** before anything is merged @@ -997,10 +1001,9 @@ We will walk through a real change to this repository, then you will practice th workflow on . --- @@ -1018,10 +1021,9 @@ A good issue is reproducible: what you did, what you expected, what happened ins --- @@ -1033,15 +1035,15 @@ A good issue is reproducible: what you did, what you expected, what happened ins **Fork** when you cannot push to the original. **Branch** when you can. Either way the change arrives as a pull request. --- @@ -1061,17 +1063,14 @@ A good issue is reproducible: what you did, what you expected, what happened ins ![w:1200](images/pr-lifecycle.svg) --- @@ -1094,15 +1093,14 @@ Reviewers can look at the rendered page, not just the diff. This is particularly --- @@ -1134,16 +1132,16 @@ Reviewers can look at the rendered page, not just the diff. This is particularly
-Review is about the change, never the person. "This function could be clearer" beats "you wrote this badly". +Review is about the change, never the person. Use "this function could be clearer" instead of "you wrote this badly".
--- @@ -1157,6 +1155,8 @@ img { max-height: 520px; }
+**In the GitHub PR:** + - **Merge commit** - keeps every commit and records the merge - **Squash** - collapses the branch into one tidy commit (a common default) - **Rebase** - replays commits with no merge commit @@ -1171,14 +1171,14 @@ img { max-height: 520px; }
--- @@ -1203,16 +1203,14 @@ section {font-size: 22px;} | Namespaces | User / organization | User / **group**, nestable |
@@ -1227,11 +1225,11 @@ While C2SM works mostly on `github.com`, many self-hosted GitLab servers are als --- @@ -1262,14 +1260,14 @@ your fork anywhere outside `git_beyond`. You will review each other's pull requests, so **work in pairs**. --- @@ -1320,14 +1318,13 @@ You will review each other's pull requests, so **work in pairs**.
--- @@ -1347,15 +1344,15 @@ You will review each other's pull requests, so **work in pairs**.
-Language models are often useful for Git because the documentation is so good. They also invent flags that do not exist. Check `git help ` before running anything you do not recognize - especially anything with `--force`. +LLMs are often helpful for Git questions, since Git is extensively documented and widely discussed. Still, check `git help ` before running anything you do not recognize - especially anything with `--force`.
--- @@ -1375,8 +1372,7 @@ Language models are often useful for Git because the documentation is so good. T --- @@ -1387,7 +1383,7 @@ Language models are often useful for Git because the documentation is so good. T diff --git a/beyond/slides/slides_beyond.pdf b/beyond/slides/slides_beyond.pdf index 8098744..dfc1469 100644 Binary files a/beyond/slides/slides_beyond.pdf and b/beyond/slides/slides_beyond.pdf differ