Skip to content

Commit e238981

Browse files
authored
Merge pull request #154 from ImperialCollegeLondon/fix-links-and-formatting
Various small fixes
2 parents 3b732a6 + 280896e commit e238981

13 files changed

+121
-120
lines changed

CODE_OF_CONDUCT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ Instances of abusive, harassing, or otherwise unacceptable behavior
99
may be reported by following our [reporting guidelines][coc-reporting].
1010

1111

12-
[coc-reporting]: https://docs.carpentries.org/topic_folders/policies/incident-reporting.html
13-
[coc]: https://docs.carpentries.org/topic_folders/policies/code-of-conduct.html
12+
[coc-reporting]: https://docs.carpentries.org/policies/coc/incident-reporting.html
13+
[coc]: https://docs.carpentries.org/policies/coc/

episodes/00-course_overview.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,10 @@ exercises: 0
2020
## Overview
2121

2222
This course builds on the [Introduction to using Git and GitHub for software
23-
development][Introduction to using Git and GitHub for software development] course. While it is not a requirement to have completed the introductory
23+
development][intro-course] course. While it is not a requirement to have completed the introductory
2424
course, basic familiarity with using Git from the command line is assumed. (Don't worry
2525
if you're rusty!) You should also have a copy of the `recipe` repository locally. If
26-
not, please refer to
27-
28-
<!-- markdownlint-disable -->
29-
30-
[the setup instructions][lesson-setup].
31-
32-
<!-- markdownlint-restore -->
26+
not, please refer to [the setup instructions](../index.md).
3327

3428
This course introduces some of the intermediate-level functionality of Git and GitHub.
3529
In addition to providing you with a more thorough understanding of Git and how to use it
@@ -77,8 +71,8 @@ style.
7771

7872

7973

80-
[Introduction to using Git and GitHub for software development]: https://imperialcollegelondon.github.io/rse_introductory_git_course/
81-
[a handout sheet]: handouts/git-course-handout.pdf
74+
[intro-course]: https://imperialcollegelondon.github.io/rse_introductory_git_course/
75+
[a handout sheet]: files/git-course-handout.pdf
8276

8377

8478
:::::::::::::::::::::::::::::::::::::::: keypoints

episodes/01-collaborating_with_git.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ Each of these examples will be shown again in a subsequent section.
2626

2727
### Differing Goals and Objectives
2828

29-
Developer 1 - "I need a new type of analysis to finish my thesis"
29+
Developer 1 -- "I need a new type of analysis to finish my thesis"
3030

31-
Developer 2 - "My problem is bigger. I need better performance to process all my
31+
Developer 2 -- "My problem is bigger. I need better performance to process all my
3232
data"
3333

34-
Even when working independently you might find you need to need to work on
34+
Even when working independently you might find you need to work on
3535
different things at different times. This is greatly compounded however when you
3636
have multiple developers all wanting to contribute to the same Git repository.
3737

@@ -44,9 +44,9 @@ about sorting out conflicts later.
4444

4545
### Access and Permissions
4646

47-
Developer 1 - "Just email me your changes. I'll save them into the master copy."
47+
Developer 1 -- "Just email me your changes. I'll save them into the master copy."
4848

49-
Developer 2 - "Ok... so why do all of my changes have to go through you?"
49+
Developer 2 -- "Ok... so why do all of my changes have to go through you?"
5050

5151
An important practical consideration is where to store the code that you're
5252
collaborating on. Usually you want everyone's contributions to end up in one
@@ -60,19 +60,19 @@ within a project.
6060

6161
### Need to Coordinate Efforts
6262

63-
Developer 1 - "I'm still waiting on those changes to the data analysis workflow."
63+
Developer 1 -- "I'm still waiting on those changes to the data analysis workflow."
6464

65-
Developer 2 - "Huh? I added those a month ago."
65+
Developer 2 -- "Huh? I added those a month ago."
6666

6767
Successfully coordinating the efforts of multiple contributors is a key
6868
challenge to avoid delay and duplication of work. GitHub can help here via
6969
**Issues** that track planned, on-going and completed work and who is doing it.
7070

7171
### Different Points of View
7272

73-
Developer 1 - "Here's what I've been working on for the last month."
73+
Developer 1 -- "Here's what I've been working on for the last month."
7474

75-
Developer 2 - "Hmmm... if we tweak things here then it might be faster."
75+
Developer 2 -- "Hmmm... if we tweak things here then it might be faster."
7676

7777
Two heads, as they say, are better than one and writing software is no
7878
exception. There is no greater benefit to collaboration than being able to pick
@@ -84,19 +84,19 @@ GitHub provides functionality for peer review via **Pull Requests**.
8484

8585
### Individual styles and preferences
8686

87-
Developer 1 - "Tabs!"
87+
Developer 1 -- "Tabs!"
8888

89-
Developer 2 - "Spaces!"
89+
Developer 2 -- "Spaces!"
9090

91-
Developer 1 - "TABS!"
91+
Developer 1 -- "TABS!"
9292

93-
Developer 2 - "SPACES!"
93+
Developer 2 -- "SPACES!"
9494

9595
Whilst it may seem trivial the tabs vs. spaces controversy is a long standing
9696
debate. A quick google search will reveal any number of discussions on the
9797
topic. Ultimately, it doesn't matter, but trouble can arise when everyone
9898
follows their own preference and you end up with a messy combination. The same
99-
logic applies in many places - consistency is king!
99+
logic applies in many places -- consistency is king!
100100

101101
To get around these sorts of issues it's a good idea to make a choice and then
102102
automatically enforce it. GitHub Actions is a **Continuous Integration** system

episodes/02-branching_merging.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ exercises: 10
2828

2929
## Differing Goals and Objectives
3030

31-
Developer 1 - "I need a new type of analysis to finish my thesis"
31+
Developer 1 -- "I need a new type of analysis to finish my thesis"
3232

33-
Developer 2 - "My problem is bigger. I need better performance to process all my
33+
Developer 2 -- "My problem is bigger. I need better performance to process all my
3434
data"
3535

3636
::::::::::::::::::::::::::::::::::::::::::::::::::
@@ -69,7 +69,7 @@ version that contains all changes:
6969
![Example of commit history with multiple branches and merges](fig/branching_full_example.png){alt='Git collaborative'}
7070

7171
- We see branching points and merging points.
72-
- Main line development is often called `main`.
72+
- Mainline development is usually carried out in a branch called `main`.
7373
- Other than this convention there is nothing special about `main`, it is just
7474
a branch.
7575
- Commits form a directed acyclic graph (arrows point from parent commits to
@@ -228,7 +228,7 @@ As mentioned previously, one of the advantages of using branches is working on
228228
different features in parallel. You may have already spotted the typo in
229229
`ingredients.md` but let's say that we've only just seen it in the midst of
230230
our work on the `experiment` branch. We could correct the typo with a new commit
231-
in `experiment` but it doesn't fit in very well here - if we decide to discard
231+
in `experiment` but it doesn't fit in very well here -- if we decide to discard
232232
our experiment then we also lose the correction. Instead it makes much more
233233
sense to create a correcting commit in `main`. First, switch to the main branch:
234234

episodes/04-rewriting_history.md

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ exercises: 15
2323
## Rewriting history with Git
2424

2525
While version control is useful to keep track of changes made to a piece of work over
26-
time, it also lets you to modify the timeline of commits. There are several totally
26+
time, it also lets you modify the timeline of commits. There are several totally
2727
legitimate reasons why you might want to do that, from keeping the commit history clean
2828
of unsuccessful attempts to do something to incorporate work done by someone else.
2929

@@ -47,7 +47,8 @@ It is not rare that, while you are working on some feature, you need to check so
4747
else in another branch. Very often this is the case when you want to try some
4848
contributor's code as part of a pull request review process (see next episodes). You
4949
can commit the work you are doing, but if it is not in a state ready to be committed,
50-
what would you do? Or you start working on a branch only to realise that it is not the one that you were planning to work on?
50+
what would you do? Or what if you start working on a branch only to realise that it is
51+
not the one that you were planning to work on?
5152

5253
`git stash` is the answer. It lets you put your current, uncommitted work aside in a
5354
special state, turning the working directory back to the way it was in the last commit.
@@ -57,47 +58,47 @@ nothing had happened.
5758

5859
The following are the `git stash` commands needed to make this happen:
5960

60-
Stash the current state of the repository, giving some message to remind yourself what
61-
was this about. The working directory becomes identical to the last commit.
61+
- Stash the current state of the repository, giving some message to remind yourself what
62+
this was about. The working directory becomes identical to the last commit.
6263

63-
```bash
64-
git stash save "Some informative message"
65-
```
64+
```bash
65+
git stash save "Some informative message"
66+
```
6667

67-
List the stashes available in reverse chronological order (last one stashed goes on
68-
top).
68+
- List the stashes available in reverse chronological order (last one stashed goes on
69+
top).
6970

70-
```bash
71-
git stash list
72-
```
71+
```bash
72+
git stash list
73+
```
7374

74-
Extract the **last stash** of the list, updating the working directory
75-
with its content.
75+
- Extract the **last stash** of the list, updating the working directory with its
76+
content.
7677

77-
```bash
78-
git stash pop
79-
```
78+
```bash
79+
git stash pop
80+
```
8081

81-
Extract the stash with the given number from the list, updating the working directory
82-
with its content.
82+
- Extract the stash with the given number from the list, updating the working directory
83+
with its content.
8384

84-
```bash
85-
git stash pop stash@{NUMBER}
86-
```
85+
```bash
86+
git stash pop stash@{NUMBER}
87+
```
8788

88-
Apply the **last stash** without removing it from the list, so you can apply it to
89-
other branches, if needed.
89+
- Apply the **last stash** without removing it from the list, so you can apply it to
90+
other branches, if needed.
9091

91-
```bash
92-
git stash apply
93-
```
92+
```bash
93+
git stash apply
94+
```
9495

95-
Apply the given stash without removing it from the list, so you can apply it to
96-
other branches, if needed.
96+
- Apply the given stash without removing it from the list, so you can apply it to
97+
other branches, if needed.
9798

98-
```bash
99-
git stash apply stash@{NUMBER}
100-
```
99+
```bash
100+
git stash apply stash@{NUMBER}
101+
```
101102

102103
If you want more information, you can [read this article on Git
103104
stash](https://www.atlassian.com/git/tutorials/saving-changes/git-stash).
@@ -122,7 +123,7 @@ stashes changes in either case.
122123
This is the simplest method of rewriting history: it lets you amend the last commit you
123124
made, maybe adding some files you forgot to stage or fixing a typo in the commit message.
124125

125-
After you have made those last minute changes - and `staged` them, if needed - all you
126+
After you have made those last minute changes -- and `staged` them, if needed -- all you
126127
need to do to amend the last commit while keeping the same commit message is:
127128

128129
```bash
@@ -160,7 +161,7 @@ detailed description.
160161
::::::::::::::::::::::::::::::::::::::: challenge
161162

162163
For details on how to choose which text editor Git will use, see [the setup
163-
instructions](lesson-setup).
164+
instructions](../index.md).
164165

165166
::::::::::::::::::::::::::::::::::::::::::::::::::
166167

@@ -178,7 +179,7 @@ git reset --soft HEAD^
178179
```
179180

180181
This resets the staging area to match the most recent commit, but leaves the working
181-
directory unchanged - so no information is lost. Now you can review the files you
182+
directory unchanged -- so no information is lost. Now you can review the files you
182183
modified, make more changes or whatever you like. When you are ready, you stage and
183184
commit your files, as usual. You can go back 2 commits, 3, etc with `HEAD^2`,
184185
`HEAD^3`... but the further you go, the more chances there are to leave commits

episodes/05-pulling_pushing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ in sync.
4242
![Push a branch without upstream yet](fig/push_u.png){alt='Git collaborative'}
4343

4444
- `push` only operates on your current branch. If you want to push another
45-
branch, you have to `checkout` that branch first.
45+
branch, you have to `switch` to that branch first.
4646
- If the upstream branch has changes you do not have in the local branch, the
4747
command will fail, requesting you to pull those changes first.
4848

@@ -144,7 +144,7 @@ branch 'spicy' set up to track 'origin/spicy'.
144144
see how your local and remote branch compare in terms of commit history.
145145
- It's best to make sure your repository is in a clean state with no staged or unstaged
146146
changes.
147-
- If the local and upstream branches have diverged - have different commit history - the
147+
- If the local and upstream branches have diverged -- have different commit history -- the
148148
command will attempt to merge both. If there are conflicts, you will need deal with
149149
them in the same way described above.
150150
- You can get a new branch that exists only in `origin` directly with `git switch BRANCH_NAME` which will automatically create a local branch with the same name

0 commit comments

Comments
 (0)