Skip to content

Commit cdcde3e

Browse files
committed
add: edit lesson
1 parent 1742c8b commit cdcde3e

File tree

2 files changed

+42
-29
lines changed

2 files changed

+42
-29
lines changed

github-git/4-edit-commit-files.md

Lines changed: 42 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,31 @@ kernelspec:
1313

1414
# Your first edits to a file in your fork
1515

16-
:::{admonition} Activity: Fork a repository and modify a file
17-
:class: tip
18-
In this lesson, you will edit a file in the demo pyOpenSci repository using the GitHub interface in your [forked repo](3-fork-repo). You do not need to [clone or make a copy of your repo locally](clone-repo) to do this!
16+
In the previous lesson, [you identified something that you wanted to fix in our example GitHub repository](3-identify-issue). Ideally, the fix that you identified is small, text-based, and can be made by modifying a single file.
1917

20-
This is a great way to make your first contribution to open source without needing to know `git` or the command line!
18+
After you [forked the repository that you want to contribute to](3-fork-repo) and received approval from a maintainer to work on the issue, it's time to move forward with a pull request!
2119

22-
:::
20+
:::{admonition} What you'll learn here
21+
:class: tip
22+
In this lesson, you will edit a file in the demo pyOpenSci repository using the GitHub interface in your [forked repo](3-fork-repo). You will then commit your changes.
2323

24-
In the previous lesson, [you selected or identified something that you wanted to fix in our example GitHub repository](3-identify-issue). Ideally, the fix that you identified is small, text-based, and can be made by modifying a single file. Small contributions are a great way to start.
24+
:::
2525

26-
After you [forked the repository](3-fork-repo) you are contributing to and received the OK to move forward with your pull request through an open issue, you are ready to get to work.
2726

28-
Here you will make the changes that you proposed to work on using only the native GitHub interface.
27+
Here, you will make the changes that you proposed to work on using only the native GitHub interface.
28+
You do not need to [clone or make a copy of your repo locally](clone-repo) to do this!
2929

3030

3131
:::{admonition} Activity: Make a change to a file and commit it to your fork
3232

33-
**1. Go to your fork**
34-
*******
35-
**2. In the GitHub interface, click on the file that you proposed to modify or fix [in the identify issue lesson](2-identify-issue).**: instructions on how to do this are below
36-
*******
37-
**3. Click on the edit <kbd><i class="fa-solid fa-pencil"></i></kbd> button in the GitHub interface.**
38-
*******
39-
**4. Make the edits that you proposed in your issue to the file.**
40-
*******
41-
**5. Hit the <kbd>commit</kbd> button to save your edits**
42-
**6. Add a descriptive commit message that describes the change that you made**
33+
It's time to make the changes to a file in your fork that you proposed in the open issue:
34+
35+
1. Navigate to your fork on GitHub.com
36+
2. In the GitHub interface, click on the file that you proposed to modify or fix [in the identify issue lesson](2-identify-issue): instructions on how to do this are below
37+
3. Click on the edit <kbd><i class="fa-solid fa-pencil"></i></kbd> button in the GitHub interface.
38+
4. Make the edits to the file that you proposed in your issue.
39+
5. Hit the <kbd>commit</kbd> button to save your edits
40+
6. Add a descriptive commit message that describes the change that you made
4341

4442
Some examples:
4543
> fix: fixed numerous typos in the filename.py file
@@ -54,31 +52,46 @@ Some examples:
5452

5553
## About editing files on GitHub
5654

57-
Editing a file on GitHub is a great way to start contributing because it allows you to focus on the contributing workflow without setting up a local development environment.
55+
Editing a file on GitHub allows you to focus on the contributing workflow without needing to learn or install git, create a local development environment, or use the command line.
56+
57+
Following this process, you can edit as many files as you wish. However, on GitHub, you must edit and commit changes to them individually.
58+
59+
### How to edit a file on GitHub
60+
61+
TODO: add a screen capture of opening and editing a file.
5862

59-
Following this process, you can edit as many files as you wish. However, given that you are editing files on GitHub, you must edit and commit them one at a time.
6063

61-
### Codespaces: Cloud-based development environments on GitHub
62-
In some cases, projects may use [GitHub codespaces](github-codespaces), which allow you to work on content in a coding environment using an interface like VSCode fully in your browser.
6364

64-
However, you will make text changes to a file to build confidence around the contributing workflow.
65+
:::{admonition} GitHub Codespaces Provide Online GitHub Development Environments
66+
67+
GitHub Codespaces are cloud development environments that can be created and used on GitHub.
68+
69+
Projects may sometimes offer [GitHub codespaces](github-codespaces), which allows you to edit multiple files and commit them together. You can also create a CodeSpace yourself in your fork!
70+
71+
GitHub Codespaces allows you to work on content in a cloud-based coding environment using an interface like VSCode fully in your browser. If set up correctly, they can contain a project's development environment.
72+
:::
6573

6674
## What is a commit?
6775

68-
Here are 3 points to remember about commits:
76+
Here are 3 points to remember when you think about commits:
6977

70-
1. A **commit** is a feature in the [git version control](what-is-git) that is similar to saving your changes with a note explaining what you did.
78+
1. A **commit** is a feature of [git version control](what-is-git) that is similar to saving your changes with a note explaining what you did.
79+
80+
2. Each commit that you make represents a set of changes to one or more files in your repository at a specific time.
81+
82+
:::{figure} /images/github/git-commits-files.png
83+
:alt: A visual example demonstrating how Git tracks changes to a document through commits. The image shows an “Original File” with its initial text, followed by two commits. The first commit adds a new paragraph of text, with the changes highlighted in green and the commit message, “Fix: added a new paragraph to clarify text.” The second commit fixes typos in the text, with the edits also highlighted in green, along with the commit message, “Fix: copy edits.” At the bottom, a comparison shows the document after each commit, illustrating how the file evolves with changes.
84+
85+
:::
7186

72-
2. Each commit that you make represents a set of changes to one or more files in your repository at a specific time.
7387

74-
3. You can always revert or undo a set of changes in the commit history. While undoing things in git takes a bit more knowledge, knowing it can be done can give you confidence to make changes without worrying about breaking things!
88+
3. Because you are using git, you can always revert or undo a set of changes in your commit history. While undoing things in git takes a bit more knowledge, knowing it can be done can give you the confidence to make changes without worrying about breaking things!
7589

7690
:::{figure} /images/github/git-what-are-commits.png
77-
:alt: Alt here
91+
:alt: A diagram explaining Git commits and their role in version control. The top section shows a timeline of circular commits, each paired with a file icon to represent file changes, with the text: “Each commit represents one or more file changes made at a specific point in time.” The middle section highlights the “Latest Commit” on the timeline, showing it as the current state of the repository. The bottom section demonstrates the concept of reverting, with an arrow pointing from a later commit back to a previous one, illustrating that Git allows reverting or going back to earlier commits. The text reads: “You can also always revert or return to a previous commit. This is what makes Git powerful.”
7892

7993
:::
8094

81-
::::
8295

8396
:::{todo}
8497
It might be cool to show first contributions like my first on to nbconvert could be interesting? Other people might have examples too from the community that we could share with some stories about it??
20.1 KB
Loading

0 commit comments

Comments
 (0)