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/pull-request.md
+55-7Lines changed: 55 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ myst_html_meta:
16
16
"property=og:locale": "en_US"
17
17
---
18
18
19
-
# How to Submit a GitHub Pull Request
19
+
# About Pull Requests
20
20
21
21
In the last lesson, you learned how to [make and commit a change to a document in a GitHub repository](edit-commit-files).
22
22
In this lesson, you will learn how to submit a pull request after making changes to a file in a GitHub repository.
@@ -27,9 +27,14 @@ A GitHub pull request (**PR**):
27
27
1.**Supports Review**: A pull request also triggers a review process where other repository owners and users can review and comment on your changes and suggest edits to your changes line-by-line. This makes incorporateing your changes fully transparent.
28
28
1.**Maintainers to manage contributions**: PRs allow maintainers to document, approve, and merge contributions into the project in a consistent way.
29
29
30
+
> **<iclass="fa-solid fa-handshake-angle"style="color: #81c0aa;"></i> Social cue:**
31
+
> A pull request is a **collaborative tool**—it lets maintainers review changes
32
+
> before merging them. PRs **show transparency** and let others give feedback,
33
+
> making sure every update aligns with the project's goals.
34
+
30
35
Pull requests empower you to contribute to the work of others in an open and accessible way, even if you don't have direct access to the repository.
31
36
32
-
## The steps
37
+
## How to Submit a GitHub Pull Request
33
38
34
39
### Step 1: Open your GitHub pull request
35
40
@@ -64,13 +69,42 @@ In this example, you want to update:
64
69
***base**: `pyopensci/pyos-demo-package-contribute` with
65
70
***head**: commits in your fork `your-username/pyos-demo-package-contribute`.
66
71
72
+
73
+
> **<iclass="fa-solid fa-code-branch"style="color: #81c0aa;"></i> Social Tip:**
74
+
> Choosing the correct **head** and **base** repositories ensures that your changes
75
+
> go to the right place. If you accidentally select the wrong base, your PR might not
76
+
> reach the maintainers you intended. Double-check this before submitting!
77
+
67
78
The above pull request configuration tells **GitHub** to update the base repository with contents from your forked repository or the head repository.
68
79
69
-
### Step 3: Verify changes in your pull request
80
+
81
+
### Set up a pull request: base vs. head
82
+
83
+
When creating a **pull request (PR)**, you must define where your changes should be added and where they come from.
84
+
85
+
-**<iclass="fa-solid fa-database"style="color: #81c0aa;"></i> Base:** The repository where you want your changes to be merged. *(This is usually the original repo you forked.)*
86
+
-**<iclass="fa-solid fa-code-branch"style="color: #81c0aa;"></i> Head:** The repository containing your changes. *(This is your fork. The copy of the repo that you own, where you made edits.)*
87
+
88
+
> **🔹 Quick way to remember:** The **head** is "ahead" of the base, meaning it has new changes that the base repository does **not** yet have.
89
+
90
+
:::{todo}
91
+
92
+
/images/github/base-vs-head.png
93
+
:alt: "Diagram showing how base and head work in GitHub pull requests."
94
+
Create Graphic: Simple diagram with arrows from "Your Fork (Head)" → "Original Repo (Base)"
95
+
96
+
:::
97
+
98
+
### Step 3: Review your own pull request first
70
99
71
100
When comparing repositories in a **pull request (PR)**, GitHub provides a **diff view** of changes between files (diff as in difference). Before submitting the pr, carefully review these changes to ensure that what you intended to submit is in the PR (and nothing else).
72
101
73
-
Since others will review your PR, take time to **clean up unnecessary changes** before submitting. your time upfront will lead to the PR being merged sooner and will make it easier for others to review.
102
+
Since others will review your PR, take time to **clean up unnecessary changes** before submitting. Your time upfront will lead to the PR being merged sooner and will make it easier for others to review.
103
+
104
+
> **<iclass="fa-solid fa-magnifying-glass"style="color: #81c0aa;"></i> Social cue:**
105
+
> A PR isn't just about submitting changes—it’s about **communicating clearly** with
106
+
> maintainers. A well-reviewed PR with **only relevant changes** is easier to merge.
107
+
> **Check that your PR doesn’t include unintended file modifications.**
74
108
75
109
Before you submit your PR, check:
76
110
@@ -93,20 +127,34 @@ Once you've reviewed your PR and everything looks good, it's time to submit it.
93
127
Add a descriptive title and write a brief description of your changes. Pull request titles should be concise and descriptive of the content in the pull request. When you have added your
94
128
title and description, click on “Create Pull Request” one more time to submit the PR.
95
129
130
+
> **<iclass="fa-solid fa-pen-to-square"style="color: #81c0aa;"></i> Social cue:**
131
+
> A **clear, descriptive PR title** helps maintainers quickly understand your changes.
132
+
> A good title is specific: **"Fix typo in README"** is better than **"Updated file"**.
133
+
> Your description should also **explain why** the change was made.
134
+
96
135
If you go to the parent repository, you will see the PR listed there.
97
136
98
137
:::{tip}
99
138
You can modify the title and description of your pull request at any time - even after you've submitted the pull request.
100
139
:::
101
140
102
-
## Close a Pull Request
141
+
## Close or move a Pull Request to draft
142
+
143
+
Sometimes, after opening a pull request, you realize it's **not quite ready for review**. In that case, you have two options:
103
144
104
-
You can close a PR anytime via the **Close pull request** button if you're not ready to submit. You can reopen it later if needed.
145
+
1.**<iclass="fa-solid fa-file-pen"style="color: #81c0aa;"></i> Convert it to a draft** – A draft pull request signals to maintainers that your PR is **still in progress** and not yet ready for review.
146
+
2.**<iclass="fa-solid fa-xmark"style="color: #81c0aa;"></i> Close the PR** – You can close a PR anytime via the **Close pull request** button and reopen it later when you're ready to submit.
105
147
106
-
## Who Can Merge a Pull Request?
148
+
## Who can merge a pull request?
107
149
108
150
When you create a **pull request (PR)**, GitHub directs you to the parent repository (e.g., the pyOpenSci repo). At the bottom of the PR, a **Merge Pull Request** button appears, which only the **repository owner** or collaborators can use after reviewing your changes.
109
151
152
+
> **<iclass="fa-solid fa-user-shield"style="color: #81c0aa;"></i> Social cue:**
153
+
> Only maintainers can merge PRs, but **you can make their job easier**!
154
+
> -**Be responsive** if they ask for changes.
155
+
> -**Follow repository guidelines** for PR structure.
156
+
> -**Check for review comments** and update your PR accordingly.
157
+
110
158
The repo owner may request modifications before merging. Any future commits to the same branch will be added to the PR until it is merged.
Copy file name to clipboardExpand all lines: github-git/your-first-contribution.md
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,10 @@ og:image:alt: An image that shows the steps for contributing to open source on G
20
20
21
21
# Mastering GitHub Collaboration Skills
22
22
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
+
25
+
This lesson series will teach you how to collaborate on code and documentation using GitHub. It will help you confidently contribute to a GitHub repository and build skills to collaborate with colleagues (some of whom you may not have met in real life!).
26
+
23
27
(first-contribution)=
24
28
25
29
## Get started with your first open source contribution
@@ -174,9 +178,14 @@ Once your PR is open, it's time to sit back and wait for the maintainers, collab
174
178
175
179
## Many people's first contributions are to documentation
176
180
177
-
In this lesson, you make your first open source contribution by updating documentation (including docstrings) rather than code. Many people start with small fixes like typos, which are simpler to contribute as you don't always need a development environment but are still valuable. Developers often focus on code, leaving less time for writing and editing documentation. So your small contributions can have a large impact.
181
+
In this lesson, you make your first open source contribution by updating documentation (including docstrings) rather than code. Many people start with small fixes like typos, which are simpler to contribute as you don't always need a development environment but are still **highly valuable**.
182
+
183
+
### <iclass="fa-solid fa-rocket"></i> Fresh eyes make a difference! <iclass="fa-solid fa-rocket"></i>
184
+
185
+
When you’re new to a project, you may notice gaps and unclear explanations that long-time contributors might overlook. Maintainers and developers are often too close to their own work to see what’s missing. Your perspective helps make the project more accessible to future contributors.
186
+
187
+
By catching confusing phrasing, outdated information, or missing details (even in contributing documentation), you improve the onboarding experience for others while making a meaningful first contribution!
178
188
179
-
Further, if you go to contribute and find that the contributing guidelines lack detail, that could also be a useful place for you to start.
180
189
181
190
:::{admonition} A real-life first contribution to PyPI
0 commit comments