Skip to content

Commit b00b2dd

Browse files
authored
Merge pull request #306 from coderefinery/radovan/same-repository
small improvements in centralized workflow episode
2 parents 89a25f0 + 168d313 commit b00b2dd

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

content/same-repository.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ pull requests, and how to use draft pull requests.
77
This exercise will form a good basis for collaboration that is suitable for
88
most research groups.
99

10+
:::{note}
11+
When you read or hear **pull request**, please think of a **change proposal**.
12+
:::
13+
1014

1115
## Exercise
1216

13-
In this exercise, we will contribute to a repository via a {term}`pull
14-
request`. This means that you propose some change, and then it is
15-
accepted (or not).
17+
In this exercise, we will contribute to a repository via a **pull request**.
18+
This means that you propose some change, and then it can be discussed and
19+
accepted (sometimes after requesting further improvements).
1620

1721
::::::{prereq} Exercise preparation
1822

@@ -75,8 +79,6 @@ contribute.
7579
you can go to your GitHub notifications in the top right corner. The
7680
maintainer can also "copy invite link" and share it within the group.
7781

78-
(unwatch)=
79-
8082
- **Watching and unwatching repositories**
8183
- Now that you are a collaborator, you get notified about new issues and pull
8284
requests via email.
@@ -140,18 +142,20 @@ This is done through the GitHub web interface. For example, you could
140142
give the name of the recipe you want to add (so that others don't add
141143
the same one). It is the "Issues" tab.
142144

145+
143146
### (2) Create a new branch.
144147

145148
If on GitHub, you can make the branch in the web interface
146-
({external:doc}`commits`). If working locally, you need
149+
({external:doc}`commits`). If working locally, you need to follow
147150
{external:doc}`local-workflow`.
148151

149152

150153
### (3) Make a change adding the recipe
151154

152155
Add a new file with the recipe in it. Commit the file. In the commit
153156
message, include the note about the issue number, saying that this
154-
will close that issue.
157+
will close that issue (right below here we show how).
158+
155159

156160
#### Cross-referencing issues and pull requests
157161

@@ -180,19 +184,18 @@ Here are all the keywords that GitHub recognizes:
180184
Then observe what happens in the issue once your commit gets merged: it will
181185
automatically close the issue and create a link between the issue and the
182186
commit. This is very useful for tracking what changes were made in response to
183-
which issue and to know from when until when precisely the issue was open.
187+
which issue and to know from when **until when precisely** the issue was open.
184188

185189

186190
### (4) Push to GitHub as a new branch
187191

188-
Covered in {external:doc}`local-workflow`.
189-
190-
Push the branch to the repository. You should end up with a branch
191-
visible in the GitHub web view.
192-
193192
This is only necessary if you created the changes locally. If you created the
194193
changes directly on GitHub, you can skip this step.
195194

195+
Push the branch to the repository. You should end up with a branch
196+
visible in the GitHub web view (if you are unsure how, see
197+
{external:doc}`local-workflow`).
198+
196199
:::::{tabs}
197200
::::{group-tab} VS Code
198201
In VS Code, you can "publish the branch" to the remote repository by clicking
@@ -210,12 +213,12 @@ and make it visible there, first verify what your remote is:
210213
```console
211214
$ git remote --verbose
212215

213-
origin git@github.com:user/centralized-workflow-exercise.git (fetch)
214-
origin git@github.com:user/centralized-workflow-exercise.git (push)
216+
origin git@github.com:USER/centralized-workflow-exercise.git (fetch)
217+
origin git@github.com:USER/centralized-workflow-exercise.git (push)
215218
```
216219

217220
In this case the remote is called `origin` and refers to the address
218-
git@github.com:user/centralized-workflow-exercise.git. Both can be used
221+
git@github.com:USER/centralized-workflow-exercise.git. Both can be used
219222
interchangeably. Make sure it points to the right repository, ideally a
220223
repository that you can write to.
221224

@@ -247,7 +250,7 @@ ADDRESS is the part that you copy from here:
247250
:width: 60%
248251
:class: with-border
249252
:alt: Copying the clone address from GitHub
250-
::::
253+
:::
251254

252255
If the remote points to the wrong place, you can change it with:
253256
```console
@@ -259,8 +262,8 @@ $ git remote set-url origin NEWADDRESS
259262

260263
### (5) Open a pull request towards the main branch
261264

262-
This is done through the GitHub web interface. We saw this in, for
263-
example, in a [previous lesson](https://coderefinery.github.io/git-intro/merging/).
265+
This is done through the GitHub web interface. We saw this
266+
in a [previous lesson](https://coderefinery.github.io/git-intro/merging/).
264267

265268

266269
### (6) Reviewing pull requests
@@ -322,7 +325,7 @@ To protect a branch in your own repository, go to "Settings" -> "Branches".
322325

323326
### Summary
324327

325-
- We used all the same pieces that we've learned the last two days
326-
- But we successfully contributed to someone else's project!
328+
- We used all the same pieces that we've learned previously.
329+
- But we successfully contributed to a **collaborative project**!
327330
- The pull request allowed us to contribute without changing directly:
328331
this is very good when it's not mainly our project.

0 commit comments

Comments
 (0)