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
og:image:alt: An image that shows the steps for contributing to open source on GitHub.
19
19
---
20
20
21
+
(pyos-edit-commit-files)=
22
+
21
23
# Your First Edits to a File in Your Fork: Edit & Commit
22
24
23
-
Now that you've [identified and comment on an issue](identify-issue), [forked the repository](fork-repo) and received approval to work on an issue, it's time to make your changes.
25
+
Now that you've [identified and comment on an issue](identify-github-issue), [forked the repository](fork-repo) and received approval to work on an issue, it's time to make your changes.
24
26
25
27
> **💡 Reminder:** Your fix should be **small and text-based**, like updating documentation or fixing a typo.
26
28
27
29
:::{admonition} What you'll learn
28
30
:class: tip
29
-
You’ll edit a file directly in your **fork** using GitHub’s interface and commit the changes using only the native GitHub interface.
31
+
You’ll edit a file directly in your **fork** using GitHub’s interface and commit the changes using only the native GitHub interface.
30
32
31
33
NOTE: If you want to work on the files locally on your laptop, you will need to [clone or make a copy of your repo locally](clone-repo).
32
34
@@ -44,15 +46,14 @@ GitHub lets you edit files right in your browser. Here’s how:
44
46
:::{figure} /images/github/edit-commit-file.gif
45
47
:alt: "GIF showing how to edit and commit a file on GitHub."
46
48
47
-
Editing a file directly in the GitHub interface is a straight forward process.
49
+
Editing a file directly in the GitHub interface is a straight forward process.
48
50
:::
49
51
50
52
> **⚡ Quick tip:** You can edit as many files as you want, but GitHub only lets you commit them **one at a time** in the browser.
51
53
52
-
53
54
## Ways to edit a file: GitHub vs. GitHub Codespaces
54
55
55
-
GitHub now offers **two ways** to edit files directly in the interface or using the [cloud-based GitHub Codespaces](about-codespace). If you’re making a small change, use GitHub’s interface. If you need to edit multiple files, try Codespaces.
56
+
GitHub now offers **two ways** to edit files directly in the interface or using the [cloud-based GitHub Codespaces](about-codespace). If you’re making a small change, use GitHub’s interface. If you need to edit multiple files, try Codespaces.
56
57
57
58
|| Option | When to Use | Pros | Limitations |
58
59
|-|---------|------------|------|-------------|
@@ -63,10 +64,10 @@ GitHub now offers **two ways** to edit files directly in the interface or using
63
64
64
65
## What is a commit?
65
66
66
-
A commit is like taking a snapshot of your changes so you can always "undo" the changes if needed. You can think of a **commit** as a save (or restore) point in git's history. Each commit captures changes you make to one or more files in the repository at a specific time; each commit includes a note explaining what you did.
67
+
A commit is like taking a snapshot of your changes so you can always "undo" the changes if needed. You can think of a **commit** as a save (or restore) point in git's history. Each commit captures changes you make to one or more files in the repository at a specific time; each commit includes a note explaining what you did.
67
68
68
69
:::{tip}
69
-
A **commit** is a feature of [git version control](what-is-git), the version control system that GitHub runs in the background.
70
+
A **commit** is a feature of [git version control](what-is-git), the version control system that GitHub runs in the background.
70
71
71
72
:::
72
73
@@ -75,16 +76,15 @@ A **commit** is a feature of [git version control](what-is-git), the version con
75
76
:::{figure} /images/github/git-commits-files.png
76
77
: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 highlighted in green and the commit message, “Fix: copy edits.” At the bottom, a comparison shows the document after each commit, illustrating how the file evolves with changes.
77
78
78
-
Each commit represents **a set of changes** at a specific time.
79
+
Each commit represents **a set of changes** at a specific time.
79
80
:::
80
81
81
82
> **🛠 Do you need to undo changes that you made?** Git lets you revert to an earlier commit, so you don’t have to worry about breaking anything.
: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.”
86
86
87
-
You can always **undo or revert** changes using Git.
87
+
You can always **undo or revert** changes using Git.
88
88
:::
89
89
90
90
:::{admonition} What's next?
@@ -94,9 +94,8 @@ You can always **undo or revert** changes using Git.
94
94
95
95
*****
96
96
97
-
[Learn how to create a pull request →](pull-request)
97
+
[Learn how to create a pull request →](pyos-pull-request)
Copy file name to clipboardExpand all lines: contribute-open-source/get-to-know-repo.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,4 +88,4 @@ The above steps will help you determine whether a project is **welcoming, respon
88
88
89
89
## Next steps
90
90
91
-
Once you have explored and gotten to know the repository and decided that it's a good project to contribute to, it's time to [find an issue to work](identify-issue). You will learn more about that next.
91
+
Once you have explored and gotten to know the repository and decided that it's a good project to contribute to, it's time to [find an issue to work](identify-github-issue). You will learn more about that next.
Copy file name to clipboardExpand all lines: contribute-open-source/github-codespaces.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ kernelspec:
13
13
14
14
# Code spaces and contributing to open source
15
15
16
-
[In the edit commit files lesson](edit-commit-files), you learned how to directly change a file on GitHub in the browser. You didn't need a special development environment to make that change in this lesson.
16
+
[In the edit commit files lesson](pyos-edit-commit-files), you learned how to directly change a file on GitHub in the browser. You didn't need a special development environment to make that change in this lesson.
17
17
18
18
However, in some cases, developers have set up a codespace for you to use on GitHub. A codespace is a cloud-based development environment that has been set up for you (or that you can create yourself) with all of the tool and dependencies that you need to work on a project.
Copy file name to clipboardExpand all lines: contribute-open-source/index.md
+5-9Lines changed: 5 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,9 +27,9 @@ GitHub is a **social coding platform** that allows individuals and teams to mana
27
27
28
28
## GitHub and open source
29
29
30
-
**Open source software (OSS)** is code that is publicly accessible—anyone can view, modify, and distribute it. GitHub provides the tools needed for open source projects to store code publically, manage contributions, track and address issues, and collaborate efficiently.
30
+
**Open source software (OSS)** is code that is publicly accessible—anyone can view, modify, and distribute it. GitHub provides the tools needed for open source projects to store code publically, manage contributions, track and address issues, and collaborate efficiently.
31
31
32
-
Specifically, in the Python language, the software is often [associated with packaging](https://www.pyopensci.org/python-package-guide/tutorials/intro.html), where you package up code and make it easier for a user to install on their computer. Reusable sofware allow developers and scientists to share common workflows rather than needing to recreate the code needed for each workflow themselves from scratch.
32
+
Specifically, in the Python language, the software is often [associated with packaging](https://www.pyopensci.org/python-package-guide/tutorials/intro.html), where you package up code and make it easier for a user to install on their computer. Reusable sofware allow developers and scientists to share common workflows rather than needing to recreate the code needed for each workflow themselves from scratch.
33
33
34
34
### Why open source communities use GitHub
35
35
@@ -97,8 +97,6 @@ GitHub is widely used in **open source** and **team-based projects** where multi
97
97
> **<iclass="fa-solid fa-users"style="color: #81c0aa;"></i> Social cue:**
98
98
> Working on GitHub is more than writing code—it’s about **communication, teamwork, and reviewing each other's work**.
99
99
100
-
101
-
102
100
## Summary
103
101
104
102
||**Feature**|**Solo Use**|**Collaborative Use**|
@@ -111,16 +109,15 @@ GitHub is widely used in **open source** and **team-based projects** where multi
111
109
:::{admonition} What's next?
112
110
:class: seealso
113
111
Now that you understand GitHub's role in **open source** and **collaboration**,
114
-
you're ready to dive into **contributing to a project!**
112
+
you're ready to dive into **contributing to a project!**
115
113
116
114
*****
117
115
118
-
<iclass="fa-brands fa-github-alt"></i> [Get started with activities to guide you through your first contribution →](your-first-contribution)
119
-
<iclass="fa-brands fa-github-alt"></i> [Learn how to identify an issue →](identify-issue)
116
+
<iclass="fa-brands fa-github-alt"></i> [Get started with activities to guide you through your first contribution →](pyos-first-contribution)
117
+
<iclass="fa-brands fa-github-alt"></i> [Learn how to identify an issue →](identify-github-issue)
120
118
<iclass="fa-brands fa-github-alt"></i> [Learn how to fork a repository →](fork-repository)
121
119
:::
122
120
123
-
124
121
:::{todo}
125
122
resources
126
123
<https://www.youtube.com/watch?v=eWxxfttcMts>
@@ -160,7 +157,6 @@ Clone a GitHub Repo <clone-repo>
"og:image:alt": An image that shows the steps for contributing to open source on GitHub.
19
19
---
20
-
21
-
# Mastering GitHub Collaboration Skills
20
+
(pyos-first-contribution)=
21
+
# Your First Open Source Contribution
22
22
23
23
Contributing to open source in a public space like GitHub can feel intimidating. You may not know the project maintainers, feel unsure about your GitHub skills, or wonder where to begin.
24
24
@@ -82,7 +82,7 @@ Open a new browser tab after reading through the [get-to-know a repo lesson](get
82
82
83
83
### Step 2: Find an issue to work on
84
84
85
-
Next, [identify an issue or bug that you want to work on](identify-issue). Sometimes, there is already an open issue in a repo that you want to address. So, reading through existing open issues before opening a new one is always a good idea. If you already have a fix in mind that doesn't exist in the existing issue list, you will [create a new issue](create-issue) in the repo.
85
+
Next, [identify an issue or bug that you want to work on](identify-github-issue). Sometimes, there is already an open issue in a repo that you want to address. So, reading through existing open issues before opening a new one is always a good idea. If you already have a fix in mind that doesn't exist in the existing issue list, you will [create a new issue](create-issue) in the repo.
86
86
87
87
:::{button-link} identify-issue.html
88
88
:color: primary
@@ -140,7 +140,7 @@ Once you've successfully forked the repo, it's time to edit the file you want to
140
140
:::{admonition} Activity: Make a change to a file and commit it to your fork
141
141
142
142
1. Navigate to your fork on GitHub.com
143
-
2. In the GitHub interface, click on the file that you proposed to modify or fix [in the identify issue lesson](identify-issue)
143
+
2. In the GitHub interface, click on the file that you proposed to modify or fix [in the identify issue lesson](identify-github-issue)
144
144
3. Click on the edit <kbd><iclass="fa-solid fa-pencil"></i></kbd> button in the GitHub interface.
145
145
4. Make the edits to the file that you proposed in your issue.
146
146
5. Hit the <kbd>commit</kbd> button to save your edits
@@ -159,7 +159,7 @@ Commit message examples:
159
159
160
160
### Step 5: Submit a pull request
161
161
162
-
Once your edits are [committed to git version control](edit-commit-files), open a <kbd>Pull Request</kbd> to the parent repository.
162
+
Once your edits are [committed to git version control](pyos-edit-commit-files), open a <kbd>Pull Request</kbd> to the parent repository.
0 commit comments