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

Contribute lesson changes upstream #2

Merged
merged 8 commits into from
Nov 17, 2024
6 changes: 5 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,15 @@ contact: '[email protected]'

# Order of episodes in your lesson
episodes:
- 01-working-practices.md
- 01-issues.md
- 02-branching.md
- 03-feature-branch.md
- 04-review.md
- Break.md
- 05-forks.md
- 06-conflict.md
- 07-history.md
- 08-rebase.md
- End.md


Expand Down
263 changes: 0 additions & 263 deletions episodes/01-collab.md

This file was deleted.

40 changes: 16 additions & 24 deletions episodes/01-working-practices.md → episodes/01-issues.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,36 @@
---
title: Working Practices
title: Issues
teaching: 10
exercises: 0
---

::::::::::::::::::::::::::::::::::::::: objectives

- Describe a simple development flow using git and GitHub.
- Create an Issue with the correct labels.
- Assign yourself to an Issue.

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

:::::::::::::::::::::::::::::::::::::::: questions

- What does using git and GitHub look like in practice?
- What information should go on an Issue?

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

Good working practices help us avoid mistakes,
keep our codebases secure,
and help us write sustainable code.
In this lesson we'll look at what good practice using
git and GitHub might look like.

The process to develop new code with git and GitHub
looks like this:

1. Open an Issue describing the feature or bug
2. Create a branch to develop your changes on
3. Make changes to your working copy
4. Write tests
5. Write documentation
6. Open a Pull Request
7. Review your changes
8. Merge the Pull Request and close the Issue
9. Tidy up your branches

## Issues

GitHub Issues (tickets) are where you plan and track work.
You can assign individuals to Issues and label them with a
relevant tag such as `bug` or `enhancement`.
Before opening a new Issue check whether there is already
one open for the feature or bug by using GitHub's search.

Here's some advice for writing good Issues:

- Be clear and concise, provide plenty of detail
- State the expected outcomes
- Tag relevant collaborators
- Break up large Issues into several small ones and or
use checklists to track tasks in the Issue

![](fig/github-issue.png){alt='A screenshot of a GitHub Issue.'}

::::::::::::::::::::::::::::::::::::::: challenge
Expand All @@ -52,6 +40,10 @@ one open for the feature or bug by using GitHub's search.
Practice opening up an Issue on your `weather` repository.
Your Issue will be a feature request for the shipping forecast.

1. Make sure you give the Issue an accurate title and description
2. Assign a label to the Issue
3. Assign yourself to the Issue

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

:::::::::::::::::::::::::::::::::::::::: keypoints
Expand Down
10 changes: 5 additions & 5 deletions episodes/03-feature-branch.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The Collaborator doesn't want to overwrite their own version of `climate`, so
needs to clone the Owner's repository to a different location than their own
repository with the same name.

To clone the Owner's repo into their `Desktop` folder, the Collaborator enters:
To clone the Owner's repository into their `Desktop` folder, the Collaborator enters:

```bash
$ git clone [email protected]:mo-eormerod/weather.git ~/Desktop/mo-eormerod-weather
Expand Down Expand Up @@ -205,14 +205,14 @@ If you don't see this notification click on the branches dropdown
, the button showing `main`,
and click on the `3_shipping-forecast` branch.

![](fig/feature-branch-1.png){alt='A screenshot of the GitHub weather repo showing the branch selection dropdown.'}
![](fig/feature-branch-1.png){alt='A screenshot of the GitHub weather repository showing the branch selection dropdown.'}

You should now see the Code view for the `3_shipping-forecast` branch
and a **Contribute** button.
Click on the **Contribute** button and select the green
**Open pull request** option.

![](fig/feature-branch-2.png){alt='A screenshot of the GitHub weather repo showing code view for the 3_shipping-forecast branch. The Contribute dropdown is expanded to show the Open pull request option.'}
![](fig/feature-branch-2.png){alt='A screenshot of the GitHub weather repository showing code view for the 3_shipping-forecast branch. The Contribute dropdown is expanded to show the Open pull request option.'}

You may have noticed when running `git push`
on the `3_shipping-forecast` branch for the first time
Expand Down Expand Up @@ -251,8 +251,8 @@ are reviewed and merged back into `main` in more detail.

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

- Add collaborators to your repo by going to the repository **Settings** then the **Collaborators** tab.
- Cloning a repo gives you a local copy of the repository:
- Add collaborators to your repository by going to the repository **Settings** then the **Collaborators** tab.
- Cloning a repository gives you a local copy of the repository:
`git clone <repository> <directory>`
- Automatically close Issues when a PR is merged by adding
a `Closes #<Issue number>` line to the first comment in the PR.
Expand Down
Loading