From ef69b325f3ad4bf57507880113c208e40f608d3d Mon Sep 17 00:00:00 2001 From: Sven van der Burg Date: Mon, 3 Feb 2025 15:56:00 +0100 Subject: [PATCH 1/2] Add branching to centralized exercise --- episodes/08-collab-centralized.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/episodes/08-collab-centralized.md b/episodes/08-collab-centralized.md index 2a3dec6..d2284e9 100644 --- a/episodes/08-collab-centralized.md +++ b/episodes/08-collab-centralized.md @@ -28,8 +28,10 @@ First we show the centralized workflow all in the browser using Github: * instructor A creates an issue (for example create ‘sum’ function) * instructor B picks up the issue -* Instructor B creates a new branch (good to do this explicitly) +* Instructor B clones the repository +* Instructor B creates a new branch, using `git switch -c new_feature` * Instructor B does some reviewable changes (a simple ‘sum’ function) +* Instructor B pushes the changes to the remote repository on GitHub using `git push origin new_feature` * Instructor B opens a new pull request. * Instructor A reviews and approves the PR. * Instructor B merges the pull request. @@ -42,9 +44,9 @@ First we show the centralized workflow all in the browser using Github: #### Exercise: Working as a project collaborator (in pairs): - PERSON A: Create an issue in the repository - PERSON B: Clone this repository to your system -- PERSON B: Create a new branch +- PERSON B: Create a new branch, using `git switch -c new_feature` - PERSON B: Make the changes requested in the issue -- PERSON B: Push the changes to the remote repository on GitHub +- PERSON B: Push the changes to the remote repository on GitHub using `git push origin new_feature` - PERSON B: Submit a Pull Request, refer to the issue (e.g. "Closes #1") - PERSON A: Review the Pull Request - PERSON B: Address the comments From a256b19eaa78f00e073591684f33b4b0046f1079 Mon Sep 17 00:00:00 2001 From: Sven van der Burg Date: Mon, 3 Feb 2025 16:07:19 +0100 Subject: [PATCH 2/2] Create a new branches episode --- config.yaml | 7 ++-- episodes/08-branches.md | 35 +++++++++++++++++++ ...entralized.md => 09-collab-centralized.md} | 0 ...istributed.md => 10-collab-distributed.md} | 0 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 episodes/08-branches.md rename episodes/{08-collab-centralized.md => 09-collab-centralized.md} (100%) rename episodes/{09-collab-distributed.md => 10-collab-distributed.md} (100%) diff --git a/config.yaml b/config.yaml index 425cda8..0aa989f 100644 --- a/config.yaml +++ b/config.yaml @@ -66,9 +66,10 @@ episodes: - 04-changes.md - 05-history.md - 06-ignore.md -- 07-github.md -- 08-collab-centralized.md -- 09-collab-distributed.md +- 07-github.md +- 08-branches.md +- 09-collab-centralized.md +- 10-collab-distributed.md # Information for Learners learners: diff --git a/episodes/08-branches.md b/episodes/08-branches.md new file mode 100644 index 0000000..0bad013 --- /dev/null +++ b/episodes/08-branches.md @@ -0,0 +1,35 @@ +--- +title: Branches +teaching: 5 +exercises: 0 +--- + +::::::::::::::::::::::::::::::::::::::: objectives + +- What are branches? + +:::::::::::::::::::::::::::::::::::::::::::::::::: + + +:::::::::::::::::::::::::::::::::::::::: questions + +- Understand what branches are and when to use them + +:::::::::::::::::::::::::::::::::::::::::::::::::: + +::: instructor +Explain what branches are and when to use them, we will practice with the git commands in the next episode. +::: + +Have a look at +[these slides introducing branches](https://esciencecenter-digital-skills.github.io/digital-skills-slides/modules/git-lesson/branches). + + +:::::::::::::::::::::::::::::::::::::::: keypoints + +- A branch represents an independent line of development. +- Subsequent changes are considered to belong to that branch. + +:::::::::::::::::::::::::::::::::::::::::::::::::: + + diff --git a/episodes/08-collab-centralized.md b/episodes/09-collab-centralized.md similarity index 100% rename from episodes/08-collab-centralized.md rename to episodes/09-collab-centralized.md diff --git a/episodes/09-collab-distributed.md b/episodes/10-collab-distributed.md similarity index 100% rename from episodes/09-collab-distributed.md rename to episodes/10-collab-distributed.md