You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: github-git/4-edit-commit-files.md
+42-29Lines changed: 42 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,33 +13,31 @@ kernelspec:
13
13
14
14
# Your first edits to a file in your fork
15
15
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.
19
17
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!
21
19
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.
23
23
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
+
:::
25
25
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.
27
26
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!
29
29
30
30
31
31
:::{admonition} Activity: Make a change to a file and commit it to your fork
32
32
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><iclass="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><iclass="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
43
41
44
42
Some examples:
45
43
> fix: fixed numerous typos in the filename.py file
@@ -54,31 +52,46 @@ Some examples:
54
52
55
53
## About editing files on GitHub
56
54
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.
58
62
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.
60
63
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.
63
64
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
+
:::
65
73
66
74
## What is a commit?
67
75
68
-
Here are 3 points to remember about commits:
76
+
Here are 3 points to remember when you think about commits:
69
77
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
+
:::
71
86
72
-
2. Each commit that you make represents a set of changes to one or more files in your repository at a specific time.
73
87
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!
: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.”
78
92
79
93
:::
80
94
81
-
::::
82
95
83
96
:::{todo}
84
97
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??
0 commit comments