Skip to content

Commit 6dc0542

Browse files
authored
Merge pull request #1081 from lexnederbragt/patch-4
Replace 'receipts' with 'pictures' to reduce issue for people with dyslexia
2 parents 711385a + cf9f2ad commit 6dc0542

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

episodes/06-ignore.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ or intermediate files created during data analysis?
2323
Let's create a few dummy files:
2424

2525
```bash
26-
$ mkdir receipts
27-
$ touch a.png b.png c.png receipts/a.jpg receipts/b.jpg
26+
$ mkdir pictures
27+
$ touch a.png b.png c.png pictures/cake1.jpg pictures/cake2.jpg
2828
```
2929

3030
and see what Git says:
@@ -41,7 +41,7 @@ Untracked files:
4141
a.png
4242
b.png
4343
c.png
44-
receipts/
44+
pictures/
4545
4646
nothing added to commit but untracked files present (use "git add" to track)
4747
```
@@ -61,7 +61,7 @@ Type the text below into the `.gitignore` file:
6161

6262
```
6363
*.png
64-
receipts/
64+
pictures/
6565
```
6666

6767
Save the file and exit your editor.
@@ -74,11 +74,11 @@ $ cat .gitignore
7474

7575
```output
7676
*.png
77-
receipts/
77+
pictures/
7878
```
7979

8080
These patterns tell Git to ignore any file whose name ends in `.png`
81-
and everything in the `receipts` directory.
81+
and everything in the `pictures` directory.
8282
(If any of these files were already being tracked,
8383
Git would continue to track them.)
8484

@@ -107,7 +107,7 @@ Let's add and commit `.gitignore`:
107107

108108
```bash
109109
$ git add .gitignore
110-
$ git commit -m "Ignore png files and the receipts folder."
110+
$ git commit -m "Ignore png files and the pictures folder."
111111
$ git status
112112
```
113113

@@ -145,7 +145,7 @@ Ignored files:
145145
a.png
146146
b.png
147147
c.png
148-
receipts/
148+
pictures/
149149
150150
nothing to commit, working tree clean
151151
```
@@ -157,27 +157,27 @@ nothing to commit, working tree clean
157157
Given a directory structure that looks like:
158158

159159
```bash
160-
receipts/data
161-
receipts/plots
160+
pictures/cake
161+
pictures/pizza
162162
```
163163

164-
How would you ignore only `receipts/plots` and not `receipts/data`?
164+
How would you ignore only `pictures/cake` and not `pictures/pizza`?
165165

166166
::::::::::::::: solution
167167

168168
## Solution
169169

170170
If you only want to ignore the contents of
171-
`receipts/plots`, you can change your `.gitignore` to ignore
172-
only the `/plots/` subfolder by adding the following line to
171+
`pictures/cake`, you can change your `.gitignore` to ignore
172+
only the `/cake/` subfolder by adding the following line to
173173
your .gitignore:
174174

175175
```output
176-
receipts/plots/
176+
pictures/cake/
177177
```
178178

179-
This line will ensure only the contents of `receipts/plots` is ignored, and
180-
not the contents of `receipts/data`.
179+
This line will ensure only the contents of `pictures/cake` is ignored, and
180+
not the contents of `pictures/pizza`.
181181

182182
As with most programming issues, there
183183
are a few alternative ways that one may ensure this ignore rule is followed.
@@ -231,13 +231,13 @@ Given a directory structure that looks similar to the earlier Nested Files
231231
exercise, but with a slightly different directory structure:
232232

233233
```bash
234-
receipts/data
235-
receipts/images
236-
receipts/plots
237-
receipts/analysis
234+
pictures/cake
235+
pictures/pizza
236+
pictures/pie
237+
pictures/brownie
238238
```
239239

240-
How would you ignore all of the contents in the receipts folder, but not `receipts/data`?
240+
How would you ignore all of the contents in the pictures folder, but not `pictures/pie`?
241241

242242
Hint: think a bit about how you created an exception with the `!` operator
243243
before.
@@ -247,13 +247,13 @@ before.
247247
## Solution
248248

249249
If you want to ignore the contents of
250-
`receipts/` but not those of `receipts/data/`, you can change your `.gitignore` to ignore
251-
the contents of receipts folder, but create an exception for the contents of the
252-
`receipts/data` subfolder. Your .gitignore would look like this:
250+
`pictures/` but not those of `pictures/pie/`, you can change your `.gitignore` to ignore
251+
the contents of pictures folder, but create an exception for the contents of the
252+
`pictures/pie` subfolder. Your .gitignore would look like this:
253253

254254
```output
255-
receipts/* # ignore everything in receipts folder
256-
!receipts/data/ # do not ignore receipts/data/ contents
255+
pictures/* # ignore everything in pictures folder
256+
!pictures/pie/ # do not ignore pictures/data/ contents
257257
```
258258

259259
:::::::::::::::::::::::::
@@ -267,23 +267,23 @@ receipts/* # ignore everything in receipts folder
267267
Assuming you have an empty .gitignore file, and given a directory structure that looks like:
268268

269269
```bash
270-
receipts/data/market_position/gps/a.dat
271-
receipts/data/market_position/gps/b.dat
272-
receipts/data/market_position/gps/c.dat
273-
receipts/data/market_position/gps/info.txt
274-
receipts/plots
270+
pictures/data/location/gps/a.dat
271+
pictures/data/location/gps/b.dat
272+
pictures/data/location/gps/c.dat
273+
pictures/data/location/gps/info.txt
274+
pictures/plots
275275
```
276276

277277
What's the shortest `.gitignore` rule you could write to ignore all `.dat`
278-
files in `receipts/data/market_position/gps`? Do not ignore the `info.txt`.
278+
files in `pictures/data/location/gps`? Do not ignore the `info.txt`.
279279

280280
::::::::::::::: solution
281281

282282
## Solution
283283

284-
Appending `receipts/data/market_position/gps/*.dat` will match every file in `receipts/data/market_position/gps`
284+
Appending `pictures/data/location/gps/*.dat` will match every file in `pictures/data/location/gps`
285285
that ends with `.dat`.
286-
The file `receipts/data/market_position/gps/info.txt` will not be ignored.
286+
The file `pictures/data/location/gps/info.txt` will not be ignored.
287287

288288

289289

0 commit comments

Comments
 (0)