-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLesson_1.html
More file actions
450 lines (392 loc) · 16 KB
/
Lesson_1.html
File metadata and controls
450 lines (392 loc) · 16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<script src="https://kit.fontawesome.com/53bd508d27.js" crossorigin="anonymous"></script>
<title>CMA: Introduction to Git</title>
<link rel="stylesheet" href="revealjs/dist/reset.css">
<link rel="stylesheet" href="revealjs/dist/reveal.css">
<link rel="stylesheet" href="revealjs/dist/theme/black.css">
<!-- CSS Plots (https://github.com/asciimoo/cssplot/)-->
<link media="all" rel="stylesheet" type="text/css" href="cssplot/build/cssplot.full.css" />
<!-- Theme used for syntax highlighted code -->
<link rel="stylesheet" href="revealjs/plugin/highlight/monokai.css">
<style>
.graph{
height: 200px;
width: 500px;
}
.svg-hline{
stroke: #fefce2;
stroke-width: 1;
}
.svg-circle{
stroke: #fefce2;
fill: #8a8e96;
}
.svg-text{
font-family: Mono;
font-size:20px;
fill: #fefce2;
dominant-baseline: middle
}
.svg-small{
font-size:15px;
}
.svg-gray{
fill: 2A9D8F
}
.highlight{
color: #E76F51
}
.pull-left {
float: left;
width: 47%;
}
.pull-right {
float: right;
width: 47%;
}
</style>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<section>
<h1 class="r-fit-text"> Exercise submissions with Git and Github </h2>
<p> Nils Ratnaweera </p>
</section>
<section>
<div class="pull-left" style="text-align:right">
<img data-src="https://www.zhaw.ch/forschungsdaten/portraet/images/rata.gif" style="border-radius:100%" width="40%">
</div>
<div class="pull-right", style="font-size:small; text-align:left">
<b>Nils Ratnaweera</b><br> <br>
ZHAW School of Life Sciences and Facility Management<br>
Institute of Natural Resource Sciences<br>
Grüentalstrasse 14<br>
8820 Wädenswil <br><br>
<i class="fa-solid fa-phone fa-fw"></i> +41 (0) 58 934 55 63 <br>
<i class="fa-solid fa-envelope fa-fw"></i> rata@zhaw.ch <br>
</div>
</section>
</section>
<section>
<section>
<h2>What?</h2>
</section>
<section data-auto-animate>
<p>In this course you will submit R-related materials:</p>
<ul>
<li> two R-exercises (exercise 2 and 3) </li>
<li> one semester project </li>
</ul>
<br> <br>
</section>
<section data-auto-animate>
<p>In this course you will submit R-related materials:</p>
<ul>
<li> two R-exercises (exercise 2 and 3) </li>
<li> one semester project </li>
</ul>
<br> <br>
<p>You will use <span class="highlight">git</span> with <span class="highlight">Github</span> for these submissions!</p>
</section>
</section>
<section>
<section>
<h2> Why <span class="highlight">git</span>?
</section>
<section>
<ul>
<li> <i class="fa-solid fa-user-lock fa-fw"></i> Safety and Control </li>
<li> <i class="fa-solid fa-network-wired fa-fw"></i> Collaboration </li>
<li> <i class="fa-solid fa-globe-americas fa-fw"></i> Community </li>
</ul>
</section>
</section>
<section>
<section>
<h2><i class="fa-solid fa-user-lock fa-fw"></i> Safety and Control</h2>
</section>
<section data-auto-animate>
<img class="r-stretch" data-src="images/phd101212s.gif">
<aside class="notes">
A typical project might look something like this.
</aside>
</section>
<section data-auto-animate>
<div class="r-hstack">
<div style="width: 30%;">
<img data-src="images/phd101212s.gif">
</div>
<div>
<svg class="graph" style="height: 200px; width: 500px;">
<g class="grid x-grid svg-hline">
<line x1="10" x2="10" y1="030" y2="060" class="fragment" data-fragment-index="2"></line>
<line x1="10" x2="10" y1="060" y2="090" class="fragment" data-fragment-index="3"></line>
<line x1="10" x2="10" y1="090" y2="120" class="fragment" data-fragment-index="4"></line>
<line x1="10" x2="10" y1="120" y2="150" class="fragment" data-fragment-index="5"></line>
<line x1="10" x2="10" y1="150" y2="180" class="fragment" data-fragment-index="6"></line>
</g>
<g class="svg-circle">
<circle cx="10" cy="030" r="5" class="fragment" data-fragment-index="1"></circle>
<circle cx="10" cy="060" r="5" class="fragment" data-fragment-index="2"></circle>
<circle cx="10" cy="090" r="5" class="fragment" data-fragment-index="3"></circle>
<circle cx="10" cy="120" r="5" class="fragment" data-fragment-index="4"></circle>
<circle cx="10" cy="150" r="5" class="fragment" data-fragment-index="5"></circle>
<circle cx="10" cy="180" r="5" class="fragment" data-fragment-index="6"></circle>
</g>
<g class="svg-text">
<text x="20" y="030" class="fragment" data-fragment-index="1">Final.doc</text>
<text x="20" y="060" class="fragment" data-fragment-index="2">Final_rev.2.doc</text>
<text x="20" y="090" class="fragment" data-fragment-index="3">FINAL_rev.6.COMMENTS.doc</text>
<text x="20" y="120" class="fragment" data-fragment-index="4">FINAL_rev.8.comments6.CORRECTIONS.doc</text>
<text x="20" y="150" class="fragment" data-fragment-index="5">FINAL_rev.18.comments7.corrections9.MORE.30.doc</text>
<text x="20" y="180" class="fragment" data-fragment-index="6">FINAL_rev.22.comments49.corrections.10.#@$%WHYDIDICOMETOGRADSCHOOL????.doc</text>
</g>
</svg>
</div>
</div>
<aside class="notes">
What is lacking:
<ul>
<li> What changed? files must be manually compared</li>
<li> When was the change made? is implicitly captured by the system, but is not reliable</li>
<li> Who made the change? very important when collaborating </li>
</ul>
</aside>
</section>
<section data-auto-animate>
<div class="r-hstack">
<div style="width: 30%;">
<img data-src="images/phd101212s.gif">
</div>
<div>
<svg class="graph">
<g class="grid x-grid svg-hline">
<line x1="10" x2="10" y1="030" y2="060"></line>
<line x1="10" x2="10" y1="060" y2="090"></line>
<line x1="10" x2="10" y1="090" y2="120"></line>
<line x1="10" x2="10" y1="120" y2="150"></line>
<line x1="10" x2="10" y1="150" y2="180"></line>
</g>
<g class="svg-circle">
<circle cx="10" cy="030" r="5"></circle>
<circle cx="10" cy="060" r="5"></circle>
<circle cx="10" cy="090" r="5"></circle>
<circle cx="10" cy="120" r="5"></circle>
<circle cx="10" cy="150" r="5"></circle>
<circle cx="10" cy="180" r="5"></circle>
</g>
<g class="svg-text">
<text x="20" y="030">commit c84ef9</text>
<text x="20" y="060">commit 12e6d8</text>
<text x="20" y="090">commit be60d0</text>
<text x="20" y="120">commit 597dfe</text>
<text x="20" y="150">commit f79a85</text>
<text x="20" y="180">commit cf9253</text>
</g>
<g class="fragment">
<g class="grid x-grid svg-hline">
<line x1="180" x2="210" y1="25" y2="010"></line>
</g>
<g class="svg-circle svg-gray">
<circle cx="210" cy="010" r="3"></circle>
</g>
<g class="svg-text svg-small">
<text x="220" y="010">Who made the commit?</text>
</g>
</g>
<g class="fragment">
<g class="grid x-grid svg-hline">
<line x1="180" x2="210" y1="25" y2="30"></line>
</g>
<g class="svg-circle svg-gray">
<circle cx="210" cy="030" r="3"></circle>
</g>
<g class="svg-text svg-small">
<text x="220" y="030">When was the commit made?</text>
</g>
</g>
<g class="fragment">
<g class="grid x-grid svg-hline">
<line x1="180" x2="210" y1="25" y2="50"></line>
</g>
<g class="svg-circle svg-gray">
<circle cx="210" cy="050" r="3"></circle>
</g>
<g class="svg-text svg-small">
<text x="220" y="050">What changed precisely?</text>
</g>
</g>
<g class="fragment">
<g class="grid x-grid svg-hline">
<line x1="180" x2="210" y1="25" y2="70"></line>
</g>
<g class="svg-circle svg-gray">
<circle cx="210" cy="070" r="3"></circle>
</g>
<g class="svg-text svg-small">
<text x="220" y="070">(Why was the commit made?)</text>
</g>
</g>
</svg>
</div>
</div>
<aside class="notes">
if we switch to Git for version control:
<ul>
<li>Changes are captured with commits</li>
<li>The filenames remain unchanged</li>
<li>Commits are identifed uniquely with automatically generated sha1 hashes, which are guaranteed to be unique</li>
<li>these are usually abbreviated to the first 6 characters</li>
</ul>
Each commit captures the following information automatically
<ul>
<li> Who made the commit?</li>
<li> When was the commit made?</li>
<li> What changed precisely ?</li>
<li> Optional: why? </li>
</ul>
Each commit requires the user to input information on why the change was made
</aside>
</section>
<section>
<p> What about Dropbox, Googledrive et al.? </p>
</section>
<section data-auto-animate>
<p>These type of software are not designed for code since files are tracked:</p>
<ul style="display: block;">
<li>individually</li>
<li>continuously</li>
<li>uncommented</li>
</ul>
</section>
<section data-auto-animate>
<p>These type of software are not designed for code since files are tracked:</p>
<ul style="display: block;">
<li><del>individually</del> <span class="highlight">individually and on a project basis</span></li>
<li>continuously</li>
<li>uncommented</li>
</ul>
</section>
<section data-auto-animate>
<p>These type of software are not designed for code since files are tracked:</p>
<ul style="display: block;">
<li><del>individually</del> <span class="highlight">individually and on a project basis</span></li>
<li><del>continuously</del> <span class="highlight">with "snapshots"</span></li>
<li>uncommented</li>
</ul>
</section>
<section data-auto-animate>
<p>These type of software are not designed for code since files are tracked:</p>
<ul style="display: block;">
<li><del>individually</del> <span class="highlight">individually and on a project basis</span></li>
<li><del>continuously</del> <span class="highlight">with "snapshots"</span></li>
<li><del>uncommented</del> <span class="highlight">with comments</span></li>
</ul>
</section>
<aside class="notes">
This can be somewhat solved by using a software that automates this for you (e.g. Dropbox, GoogleDrive)
</aside>
<section data-background-image="images/rock-climbing-mod.jpg" data-background-opacity = "0.3">
Git is your safety rope, so that you don't fall (too far)
</section>
</section>
<section>
<section><h2><i class="fa-solid fa-network-wired fa-fw"></i> Collaboration</h2></section>
<section>
<ul>
<li>Git makes collaboration smoother</li>
<li>Git repositories can easily be synced with Git servers (e.g. GitHub, Bitbucket or Gitlab)</li>
<li>Track changes works online as well as offline</li>
<li>Conflicts are rare <sup>1</sup> and very specific <sup>2</sup></li>
</ul>
<aside class="notes">
<ul>
<li>1 Conflicts only occur when the same line has been changed.</li>
<li>2 Conflicts are specific to that line</li>
<li>Note: Github != Git</li>
</ul>
</aside>
</section>
</section>
<section>
<section><h2><i class="fa-solid fa-globe-americas fa-fw"></i> Community</h2></section>
<section>
We will use Github for this course, which will give you access to a great community!
</section>
<section>
In addition to hosting Git repos, Github is a social media platform for geeks. You can:
<ul>
<li class="fragment"> <i class="fa-solid fa-thumbs-up fa-fw"></i> like repos</li>
<li class="fragment"> <i class="fa-solid fa-binoculars fa-fw"></i> follow developers</li>
<li class="fragment"> <i class="fa-solid fa-question-circle fa-fw"></i> ask questions</li>
<li class="fragment"> <i class="fa-solid fa-lightbulb fa-fw"></i> make suggestions</li>
<li class="fragment"> <i class="fa-solid fa-portrait fa-fw"></i> build your own portfolio on Github</li>
</ul>
</section>
<section>
<a href="https://github.com/geopandas/geo-arrow-spec/issues/15">
<img data-src="images/gh-issues.png" style="object-fit: cover; object-position: 0px 0px;height: 800px; width: 500px;">
</a>
</section>
<section>
<img data-src="images/unnamed-chunk-6-1.png">
<aside class="notes">
Does everyone know what CRAN is?
</aside>
</section>
</section>
<section>
<section data-auto-animate><h2><i class="fa-solid fa-triangle-exclamation"></i> A few caveats</h2></section>
<section data-auto-animate>
<h2><i class="fa-solid fa-triangle-exclamation"></i> A few caveats</h2>
<ul style="font-size: smaller;">
<li class="fragment" data-fragment-index="1">Learning Git can cause some initial pain</li>
<li class="fragment" data-fragment-index="2">New workflow / new habits when coding</li>
<li class="fragment" data-fragment-index="3">new terminology (<code>stage</code>, <code>commit</code>, <code>push</code>, <code>pull</code>...)</li>
<li class="fragment" data-fragment-index="4">Installation / preperation</li>
<ul>
<li class="fragment" data-fragment-index="5">Install the Git-software <span class="fragment highlight" data-fragment-index="8">✓</span></li>
<li class="fragment" data-fragment-index="6">Setup RStudio to work with Git <span class="fragment highlight" data-fragment-index="9">✓</span></li>
<li class="fragment" data-fragment-index="7">Create a Github account <span class="fragment highlight" data-fragment-index="10">(next week)</span></li>
</ul>
</ul>
</section>
<section>
Todays goals:<br><br>
<ul>
<li class="fragment">Initialize an <span class="highlight">RStudio Project</span> with Git Version control</li>
<li class="fragment">Commit your work progress to your <span class="highlight">local</span> repository</li>
</ul>
<aside class="notes">
We recommend working in RStudio Projects, since this simplifies many problems (working directory, unsaved documents..)
</aside>
</section>
<section>
<iframe title="Podlove Web Player: CRE: Technik, Kultur, Gesellschaft - CRE130 Verteilte Versionskontrollsysteme" width="320" height="400" src="https://cdn.podlove.org/web-player/share.html?episode=https%3A%2F%2Fcre.fm%2F%3Fpodlove_player4%3D481" frameborder="0" scrolling="no" tabindex="0"></iframe>
</section>
</section>
</div>
</div>
<script src="revealjs/dist/reveal.js"></script>
<script src="revealjs/plugin/notes/notes.js"></script>
<script src="revealjs/plugin/markdown/markdown.js"></script>
<script src="revealjs/plugin/highlight/highlight.js"></script>
<script>
// More info about initialization & config:
// - https://revealjs.com/initialization/
// - https://revealjs.com/config/
Reveal.initialize({
hash: true,
mouseWheel: true,
// Learn about plugins: https://revealjs.com/plugins/
plugins: [ RevealMarkdown, RevealHighlight, RevealNotes ]
});
</script>
</body>
</html>