Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branches #47

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
35 changes: 35 additions & 0 deletions episodes/08-branches.md
Original file line number Diff line number Diff line change
@@ -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).


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to explain here at least briefly git switch, git branch, git checkout (there are always people who ask about it). And add an exercise about it as in e.g. https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging??

:::::::::::::::::::::::::::::::::::::::: keypoints

- A branch represents an independent line of development.
- Subsequent changes are considered to belong to that branch.

::::::::::::::::::::::::::::::::::::::::::::::::::


Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
File renamed without changes.