forked from swcarpentry/git-novice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
instructor-notes.html
899 lines (848 loc) · 43.9 KB
/
instructor-notes.html
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
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
<!DOCTYPE html>
<!-- START: inst/pkgdown/templates/layout.html --><!-- Generated by pkgdown: do not edit by hand --><html lang="en" data-bs-theme="auto">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Version Control with Git: Instructor Notes</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="assets/themetoggle.js"></script><link rel="stylesheet" type="text/css" href="assets/styles.css">
<script src="assets/scripts.js" type="text/javascript"></script><!-- mathjax --><script type="text/x-mathjax-config">
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML", "output/PreviewHTML"],
extensions: ["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js", "fast-preview.js", "AssistiveMML.js", "a11y/accessibility-menu.js"],
TeX: {
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
},
tex2jax: {
inlineMath: [['\\(', '\\)']],
displayMath: [ ['$$','$$'], ['\\[', '\\]'] ],
processEscapes: true
}
});
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><!-- Responsive Favicon for The Carpentries --><link rel="apple-touch-icon" sizes="180x180" href="favicons/swc/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicons/swc/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicons/swc/favicon-16x16.png">
<link rel="manifest" href="favicons/swc/site.webmanifest">
<link rel="mask-icon" href="favicons/swc/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="white">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="black">
</head>
<body>
<header id="top" class="navbar navbar-expand-md top-nav software"><svg xmlns="http://www.w3.org/2000/svg" class="d-none"><symbol id="check2" viewbox="0 0 16 16"><path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"></path></symbol><symbol id="circle-half" viewbox="0 0 16 16"><path d="M8 15A7 7 0 1 0 8 1v14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"></path></symbol><symbol id="moon-stars-fill" viewbox="0 0 16 16"><path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"></path><path d="M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z"></path></symbol><symbol id="sun-fill" viewbox="0 0 16 16"><path d="M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"></path></symbol></svg><a class="visually-hidden-focusable skip-link" href="#main-content">Skip to main content</a>
<div class="container-fluid top-nav-container">
<div class="col-md-8">
<div class="large-logo">
<img id="swc-logo" alt="Software Carpentry" src="assets/images/software-logo.svg">
</div>
</div>
<div class="selector-container">
<div id="theme-selector">
<li class="nav-item dropdown" id="theme-button-list">
<button class="btn btn-link nav-link px-0 px-lg-2 dropdown-toggle d-flex align-items-center" id="bd-theme" type="button" aria-expanded="false" data-bs-toggle="dropdown" data-bs-display="static" aria-label="Toggle theme (auto)">
<svg class="bi my-1 theme-icon-active"><use href="#circle-half"></use></svg><i data-feather="chevron-down"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="bd-theme-text">
<li>
<button type="button" class="btn dropdown-item d-flex align-items-center" data-bs-theme-value="light" aria-pressed="false">
<svg class="bi me-2 theme-icon"><use href="#sun-fill"></use></svg>
Light
<svg class="bi ms-auto d-none"><use href="#check2"></use></svg></button>
</li>
<li>
<button type="button" class="btn dropdown-item d-flex align-items-center" data-bs-theme-value="dark" aria-pressed="false">
<svg class="bi me-2 theme-icon"><use href="#moon-stars-fill"></use></svg>
Dark
<svg class="bi ms-auto d-none"><use href="#check2"></use></svg></button>
</li>
<li>
<button type="button" class="btn dropdown-item d-flex align-items-center active" data-bs-theme-value="auto" aria-pressed="true">
<svg class="bi me-2 theme-icon"><use href="#circle-half"></use></svg>
Auto
<svg class="bi ms-auto d-none"><use href="#check2"></use></svg></button>
</li>
</ul>
</li>
</div>
<div class="dropdown" id="instructor-dropdown">
<button class="btn btn-secondary dropdown-toggle bordered-button" type="button" id="dropdownMenu1" data-bs-toggle="dropdown" aria-expanded="false">
<i aria-hidden="true" class="icon" data-feather="eye"></i> Learner View <i data-feather="chevron-down"></i>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><button class="dropdown-item" type="button" onclick="window.location.href='instructor/instructor-notes.html';">Instructor View</button></li>
</ul>
</div>
</div>
</div>
<hr></header><nav class="navbar navbar-expand-xl bottom-nav software" aria-label="Main Navigation"><div class="container-fluid nav-container">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle Navigation">
<span class="navbar-toggler-icon"></span>
<span class="menu-title">Menu</span>
</button>
<div class="nav-logo">
<img class="small-logo" alt="Software Carpentry" src="assets/images/software-logo-sm.svg">
</div>
<div class="lesson-title-md">
Version Control with Git
</div>
<div class="search-icon-sm">
<!-- TODO: do not show until we have search
<i role="img" aria-label="Search the All In One page" data-feather="search"></i>
-->
</div>
<div class="desktop-nav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<span class="lesson-title">
Version Control with Git
</span>
</li>
<li class="nav-item">
<a class="nav-link" href="key-points.html">Key Points</a>
</li>
<li class="nav-item">
<a class="nav-link" href="reference.html#glossary">Glossary</a>
</li>
<li class="nav-item">
<a class="nav-link" href="profiles.html">Learner Profiles</a>
</li>
<li class="nav-item dropdown">
<button class="nav-link dropdown-toggle" id="navbarDropdown" data-bs-toggle="dropdown" aria-expanded="false">
More <i data-feather="chevron-down"></i>
</button>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="discuss.html">Discussion</a></li>
<li><a class="dropdown-item" href="reference.html">Git Cheatsheets for Quick Reference</a></li>
</ul>
</li>
</ul>
</div>
<!--
<form class="d-flex col-md-2 search-form">
<fieldset disabled>
<input class="form-control me-2 searchbox" type="search" placeholder="" aria-label="">
<button class="btn btn-outline-success tablet-search-button" type="submit">
<i class="search-icon" data-feather="search" role="img" aria-label="Search the All In One page"></i>
</button>
</fieldset>
</form>
-->
<a id="search-button" class="btn btn-primary" href="aio.html" role="button" aria-label="Search the All In One page">Search the All In One page</a>
</div>
<!--/div.container-fluid -->
</nav><div class="col-md-12 mobile-title">
Version Control with Git
</div>
<aside class="col-md-12 lesson-progress"><div style="width: %" class="percentage">
%
</div>
<div class="progress software">
<div class="progress-bar software" role="progressbar" style="width: %" aria-valuenow="" aria-label="Lesson Progress" aria-valuemin="0" aria-valuemax="100">
</div>
</div>
</aside><div class="container">
<div class="row">
<!-- START: inst/pkgdown/templates/navbar.html -->
<div id="sidebar-col" class="col-lg-4">
<div id="sidebar" class="sidebar">
<nav aria-labelledby="flush-headingEleven"><button role="button" aria-label="close menu" alt="close menu" aria-expanded="true" aria-controls="sidebar" class="collapse-toggle" data-collapse="Collapse " data-episodes="Episodes ">
<i class="search-icon" data-feather="x" role="img"></i>
</button>
<div class="sidebar-inner">
<div class="row mobile-row" id="theme-row-mobile">
<div class="col" id="theme-selector">
<li class="nav-item dropdown" id="theme-button-list">
<button class="btn btn-link nav-link px-0 px-lg-2 dropdown-toggle d-flex align-items-center" id="bd-theme" type="button" aria-expanded="false" data-bs-toggle="dropdown" data-bs-display="static" aria-label="Toggle theme (auto)">
<svg class="bi my-1 theme-icon-active"><use href="#circle-half"></use></svg><span class="d-lg-none ms-1" id="bd-theme-text">Toggle Theme</span>
</button>
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="bd-theme-text">
<li>
<button type="button" class="btn dropdown-item d-flex align-items-center" data-bs-theme-value="light" aria-pressed="false">
<svg class="bi me-2 theme-icon"><use href="#sun-fill"></use></svg>
Light
<svg class="bi ms-auto d-none"><use href="#check2"></use></svg></button>
</li>
<li>
<button type="button" class="btn dropdown-item d-flex align-items-center" data-bs-theme-value="dark" aria-pressed="false">
<svg class="bi me-2 theme-icon"><use href="#moon-stars-fill"></use></svg>
Dark
<svg class="bi ms-auto d-none"><use href="#check2"></use></svg></button>
</li>
<li>
<button type="button" class="btn dropdown-item d-flex align-items-center active" data-bs-theme-value="auto" aria-pressed="true">
<svg class="bi me-2 theme-icon"><use href="#circle-half"></use></svg>
Auto
<svg class="bi ms-auto d-none"><use href="#check2"></use></svg></button>
</li>
</ul>
</li>
</div>
</div>
<div class="row mobile-row">
<div class="col">
<div class="sidenav-view-selector">
<div class="accordion accordion-flush" id="accordionFlush9">
<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingNine">
<button class="accordion-button collapsed" id="instructor" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseNine" aria-expanded="false" aria-controls="flush-collapseNine">
<i id="eye" aria-hidden="true" class="icon" data-feather="eye"></i> Learner View
</button>
</h2>
<div id="flush-collapseNine" class="accordion-collapse collapse" aria-labelledby="flush-headingNine" data-bs-parent="#accordionFlush2">
<div class="accordion-body">
<a href="instructor/instructor-notes.html">Instructor View</a>
</div>
</div>
</div>
<!--/div.accordion-item-->
</div>
<!--/div.accordion-flush-->
</div>
<!--div.sidenav-view-selector -->
</div>
<!--/div.col -->
<hr>
</div>
<!--/div.mobile-row -->
<div class="accordion accordion-flush" id="accordionFlush11">
<div class="accordion-item">
<button id="chapters" class="accordion-button show" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseEleven" aria-expanded="false" aria-controls="flush-collapseEleven">
<h2 class="accordion-header chapters" id="flush-headingEleven">
EPISODES
</h2>
</button>
<div id="flush-collapseEleven" class="accordion-collapse show collapse" aria-labelledby="flush-headingEleven" data-bs-parent="#accordionFlush11">
<div class="accordion-body">
<div class="accordion accordion-flush" id="accordionFlush1">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading1">
<a href="index.html">Summary and Setup</a>
</div>
<!--/div.accordion-header-->
</div>
<!--/div.accordion-item-->
</div>
<!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush2">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading2">
<a href="01-basics.html">1. Automated Version Control</a>
</div>
<!--/div.accordion-header-->
</div>
<!--/div.accordion-item-->
</div>
<!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush3">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading3">
<a href="02-setup.html">2. Setting Up Git</a>
</div>
<!--/div.accordion-header-->
</div>
<!--/div.accordion-item-->
</div>
<!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush4">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading4">
<a href="03-create.html">3. Creating a Repository</a>
</div>
<!--/div.accordion-header-->
</div>
<!--/div.accordion-item-->
</div>
<!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush5">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading5">
<a href="04-changes.html">4. Tracking Changes</a>
</div>
<!--/div.accordion-header-->
</div>
<!--/div.accordion-item-->
</div>
<!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush6">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading6">
<a href="05-history.html">5. Exploring History</a>
</div>
<!--/div.accordion-header-->
</div>
<!--/div.accordion-item-->
</div>
<!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush7">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading7">
<a href="06-ignore.html">6. Ignoring Things</a>
</div>
<!--/div.accordion-header-->
</div>
<!--/div.accordion-item-->
</div>
<!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush8">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading8">
<a href="07-github.html">7. Remotes in GitHub</a>
</div>
<!--/div.accordion-header-->
</div>
<!--/div.accordion-item-->
</div>
<!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush9">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading9">
<a href="08-collab.html">8. Collaborating</a>
</div>
<!--/div.accordion-header-->
</div>
<!--/div.accordion-item-->
</div>
<!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush10">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading10">
<a href="09-conflict.html">9. Conflicts</a>
</div>
<!--/div.accordion-header-->
</div>
<!--/div.accordion-item-->
</div>
<!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush11">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading11">
<a href="10-open.html">10. Open Science</a>
</div>
<!--/div.accordion-header-->
</div>
<!--/div.accordion-item-->
</div>
<!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush12">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading12">
<a href="11-licensing.html">11. Licensing</a>
</div>
<!--/div.accordion-header-->
</div>
<!--/div.accordion-item-->
</div>
<!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush13">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading13">
<a href="12-citation.html">12. Citation</a>
</div>
<!--/div.accordion-header-->
</div>
<!--/div.accordion-item-->
</div>
<!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush14">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading14">
<a href="13-hosting.html">13. Hosting</a>
</div>
<!--/div.accordion-header-->
</div>
<!--/div.accordion-item-->
</div>
<!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush15">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading15">
<a href="14-supplemental-rstudio.html">14. Supplemental: Using Git from RStudio</a>
</div>
<!--/div.accordion-header-->
</div>
<!--/div.accordion-item-->
</div>
<!--/div.accordion-flush-->
</div>
</div>
</div>
<hr class="half-width">
<div class="accordion accordion-flush lesson-resources" id="accordionFlush12">
<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingTwelve">
<button class="accordion-button collapsed" id="lesson-resources" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseTwelve" aria-expanded="false" aria-controls="flush-collapseTwelve">
RESOURCES
</button>
</h2>
<div id="flush-collapseTwelve" class="accordion-collapse collapse" aria-labelledby="flush-headingTwelve" data-bs-parent="#accordionFlush12">
<div class="accordion-body">
<ul>
<li>
<a href="key-points.html">Key Points</a>
</li>
<li>
<a href="reference.html#glossary">Glossary</a>
</li>
<li>
<a href="profiles.html">Learner Profiles</a>
</li>
<li><a href="discuss.html">Discussion</a></li>
<li><a href="reference.html">Git Cheatsheets for Quick Reference</a></li>
</ul>
</div>
</div>
</div>
</div>
<hr class="half-width lesson-resources">
<a href="aio.html">See all in one page</a>
<hr class="d-none d-sm-block d-md-none">
<div class="d-grid gap-1">
</div>
</div>
<!-- /div.accordion -->
</div>
<!-- /div.sidebar-inner -->
</nav>
</div>
<!-- /div.sidebar -->
</div>
<!-- /div.sidebar-col -->
<!-- END: inst/pkgdown/templates/navbar.html-->
<!-- START: inst/pkgdown/templates/content-extra.html -->
<div class="col-xl-8 col-lg-12 primary-content">
<main id="main-content" class="main-content"><div class="container lesson-content">
<h1>Instructor Notes</h1>
<p>Using a software tool to handle the versions of your project files
lets you focus on the more interesting/innovative aspects of your
project.</p>
<ul>
<li>Version control’s advantages
<ul>
<li>It’s easy to set up</li>
<li>Every copy of a Git repository is a full backup of a project and its
history</li>
<li>A few easy-to-remember commands are all you need for most day-to-day
version control tasks</li>
<li>The <a href="https://github.com/" class="external-link">GitHub</a> hosting service
provides a web-based collaboration service</li>
</ul>
</li>
<li>Two main concepts
<ul>
<li>
<em>commit</em>: a recorded set of changes in your project’s
files</li>
<li>
<em>repository</em>: the history of all your project’s commits</li>
</ul>
</li>
<li>Why use GitHub?
<ul>
<li>No need for a server: easy to set up</li>
<li>GitHub’s strong community: your colleagues are probably already
there</li>
</ul>
</li>
</ul>
<section><h2 class="section-heading" id="overall">Overall<a class="anchor" aria-label="anchor" href="#overall"></a>
</h2>
<hr class="half-width">
<p>Version control might be the most important topic we teach, but Git
is definitely the most complicated tool. However, GitHub presently
dominates the open software repository landscape, so the time and effort
required to teach fundamental Git is justified and worthwhile.</p>
<p>Because of this complexity, we don’t teach novice learners about many
interesting topics, such as branching, hashes, and commit objects.</p>
<p>Instead we try to convince them that version control is useful for
researchers working in teams or not, because it is</p>
<ul>
<li>a better way to “undo” changes,</li>
<li>a better way to collaborate than mailing files back and forth,
and</li>
<li>a better way to share your code and other scientific work with the
world.</li>
</ul></section><section><h2 class="section-heading" id="teaching-notes">Teaching Notes<a class="anchor" aria-label="anchor" href="#teaching-notes"></a>
</h2>
<hr class="half-width">
<ul>
<li><p>You can “split” your shell so that recent commands remain in view
using <a href="https://github.com/rgaiacs/swc-shell-split-window" class="external-link">this</a>
script.</p></li>
<li><p>Make sure the network is working <em>before</em> starting this
lesson.</p></li>
<li><p>Drawings are particularly useful in this lesson: if you have a
whiteboard, <a href="https://marklodato.github.io/visual-git-guide/index-en.html" class="external-link">use
it</a>!</p></li>
<li><p>Version control is usually not the first subject in a workshop,
so get learners to create a GitHub account after the session before.
Remind learners that the username and email they use for GitHub (and
setup during Git configuration) will be viewable to the public by
default. However, there are many reasons why a learner may not want
their personal information viewable, and GitHub has <a href="https://help.github.com/articles/keeping-your-email-address-private/" class="external-link">resources
for keeping an email address private</a>.</p></li>
<li><p>If some learners are using Windows, there will inevitably be
issues merging files with different line endings. (Even if everyone’s on
some flavor of Unix, different editors may or may not add a newline to
the last line of a file.) Take a moment to explain these issues, since
learners will almost certainly trip over them again. If learners are
running into line ending problems, GitHub has a <a href="https://docs.github.com/en/github/using-git/configuring-git-to-handle-line-endings" class="external-link">page</a>
that helps with troubleshooting. Specifically, the <a href="https://docs.github.com/en/github/using-git/configuring-git-to-handle-line-endings#refreshing-a-repository-after-changing-line-endings" class="external-link">section
on refreshing a repository</a> may be helpful if learners need to change
the <code>core.autocrlf</code> setting after already having made one or
more commits.</p></li>
<li><p>We don’t use a Git GUI in these notes because we haven’t found
one that installs easily and runs reliably on the three major operating
systems, and because we want learners to understand what commands are
being run. That said, instructors should demo a GUI on their desktop at
some point during this lesson and point learners at <a href="https://git-scm.com/downloads/guis" class="external-link">this page</a>.</p></li>
<li><p>Instructors should show learners graphical diff/merge tools like
<a href="https://sourcegear.com/diffmerge/" class="external-link">DiffMerge</a>.</p></li>
<li><p>When appropriate, explain that we teach Git rather than CVS,
Subversion, or Mercurial primarily because of GitHub’s growing
popularity: CVS and Subversion are now seen as legacy systems, and
Mercurial isn’t nearly as widely used in the sciences right
now.</p></li>
<li>
<p>Further resources:</p>
<ul>
<li>
<a href="https://github.com/jlord/git-it" class="external-link">git-it</a> is a self-paced
command-line Git demo, with <a href="https://github.com/jlord/git-it-electron" class="external-link">git-it-electron</a> its
GitHub Desktop successor.</li>
<li>
<a href="https://www.codeschool.com/" class="external-link">Code School</a> has a free
interactive course, <a href="https://try.github.io" class="external-link">Try Git</a>.</li>
<li>for instructors, <a href="https://tom.preston-werner.com/2009/05/19/the-git-parable.html" class="external-link">the
Git parable</a> is useful background reading</li>
</ul>
</li>
</ul></section><section><h2 class="section-heading" id="automated-version-control">
<a href="01-basics.html">Automated Version Control</a><a class="anchor" aria-label="anchor" href="#automated-version-control"></a>
</h2>
<hr class="half-width">
<ul>
<li><p>Ask, “Who uses ‘undo’ in their editor?” All say “Me”. ‘Undo’ is
the simplest form of version control.</p></li>
<li><p>Give learners a five-minute overview of what version control does
for them before diving into the watch-and-do practicals. Most of them
will have tried to co-author papers by emailing files back and forth, or
will have biked into the office only to realize that the USB key with
last night’s work is still on the kitchen table. Instructors can also
make jokes about directories with names like “final version”, “final
version revised”, “final version with reviewer three’s corrections”,
“really final version”, and, “come on this really has to be the last
version” to motivate version control as a better way to collaborate and
as a better way to back work up.</p></li>
</ul></section><section><h2 class="section-heading" id="setting-up-git">
<a href="02-setup.html">Setting Up Git</a><a class="anchor" aria-label="anchor" href="#setting-up-git"></a>
</h2>
<hr class="half-width">
<ul>
<li>
<p>We suggest instructors and students use <code>nano</code> as the
text editor for this lessons because</p>
<ul>
<li>it runs in all three major operating systems,</li>
<li>it runs inside the shell (switching windows can be confusing to
students), and</li>
<li>it has shortcut help at the bottom of the window.</li>
</ul>
<p>Please point out to students during setup that they can and should
use another text editor if they’re already familiar with it.</p>
</li>
<li><p>When setting up Git, be very clear what learners have to enter:
it is common for them to edit the instructor’s details (e.g. email).
Check at the end using <code>git config --list</code>.</p></li>
<li><p>When setting up the default branch name, if learners have a Git
version older than 2.28, the default branch name can be changed for the
lesson using <code>git branch -M main</code> if there are currently
commits in the repository, or <code>git checkout -b main</code> if there
are no commits/the repository is completely empty.</p></li>
</ul></section><section><h2 class="section-heading" id="creating-a-repository">
<a href="03-create.html">Creating a Repository</a><a class="anchor" aria-label="anchor" href="#creating-a-repository"></a>
</h2>
<hr class="half-width">
<ul>
<li><p>When you do <code>git status</code>, Mac users may see a
<code>.DS_Store</code> file showing as untracked. This a file that Mac
OS creates in each directory.</p></li>
<li>
<p>The challenge “Places to create repositories” tries to reinforce
the idea that the <code>.git</code> folder contains the whole Git repo
and deleting this folder undoes a <code>git init</code>. It also gives
the learner the way to fix the common mistake of putting unwanted
folders (like <code>Desktop</code>) under version control.</p>
<p>Instead of removing the <code>.git</code> folder directly, you can
choose to move it first to a safer directory and remove it from
there:</p>
<div class="codewrapper sourceCode" id="cb1">
<h3 class="code-label">BASH<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="sourceCode bash" tabindex="0"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a><span class="ex">$</span> mv .git temp_git</span>
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a><span class="ex">$</span> rm <span class="at">-rf</span> temp_git</span></code></pre>
</div>
<p>The challenge suggests that it is a bad idea to create a Git repo
inside another repo. For more discussion on this topic, please see <a href="https://github.com/swcarpentry/git-novice/issues/272" class="external-link">this
issue</a>.</p>
</li>
</ul></section><section><h2 class="section-heading" id="tracking-changes">
<a href="04-changes.html">Tracking Changes</a><a class="anchor" aria-label="anchor" href="#tracking-changes"></a>
</h2>
<hr class="half-width">
<ul>
<li><p>It’s important that learners do a full commit cycle by themselves
(make changes, <code>git diff</code>, <code>git add</code>, and
<code>git commit</code>). The “<code>bio</code> repository” challenge
does that.</p></li>
<li><p>This is a good moment to show a diff with a graphical diff tool.
If you skip it because you’re short on time, show it once in
GitHub.</p></li>
<li><p>One thing may cause confusion is recovering old versions. If,
instead of doing <code>$ git checkout f22b25e guacamole.md</code>,
someone does <code>$ git checkout f22b25e</code>, they wind up in the
“detached HEAD” state and confusion abounds. It’s then possible to keep
on committing, but things like <code>git push origin main</code> a bit
later will not give easily comprehensible results. It also makes it look
like commits can be lost. To “re-attach” HEAD, use
<code>git checkout main</code>.</p></li>
<li><p>This is a good moment to show a log within a Git GUI. If you skip
it because you’re short on time, show it once in GitHub.</p></li>
</ul></section><section><h2 class="section-heading" id="ignoring-things">
<a href="06-ignore.html">Ignoring Things</a><a class="anchor" aria-label="anchor" href="#ignoring-things"></a>
</h2>
<hr class="half-width">
<p>Just remember that you can use wildcards and regular expressions to
ignore a particular set of files in <code>.gitignore</code>.</p>
</section><section><h2 class="section-heading" id="remotes-in-github">
<a href="07-github.html">Remotes in GitHub</a><a class="anchor" aria-label="anchor" href="#remotes-in-github"></a>
</h2>
<hr class="half-width">
<ul>
<li><p>Make it clear that Git and GitHub are not the same thing: Git is
an open source version control tool, GitHub is a company that hosts Git
repositories in the web and provides a web interface to interact with
repos they host.</p></li>
<li><p>It is very useful to draw a diagram showing the different
repositories involved.</p></li>
<li><p>When pushing to a remote, the output from Git can vary slightly
depending on what leaners execute. The lesson displays the output from
git if a learner executes <code>git push origin main</code>. However,
some learners might use syntax suggested by GitHub for pushing to a
remote with an existing repository, which is
<code>git push -u origin main</code>. Learners using syntax from GitHub,
<code>git push -u origin main</code>, will have slightly different
output, including the line
<code>Branch main set up to track remote branch main from origin by rebasing.</code></p></li>
</ul></section><section><h2 class="section-heading" id="collaborating">
<a href="08-collab.html">Collaborating</a><a class="anchor" aria-label="anchor" href="#collaborating"></a>
</h2>
<hr class="half-width">
<ul>
<li><p>Decide in advance whether all the learners will work in one
shared repository, or whether they will work in pairs (or other small
groups) in separate repositories. The former is easier to set up; the
latter runs more smoothly.</p></li>
<li><p>Role playing between two instructors can be effective when
teaching the collaboration and conflict sections of the lesson. One
instructor can play the role of the repository owner, while the second
instructor can play the role of the collaborator. If it is possible, try
to use two projectors so that the computer screens of both instructors
can be seen. This makes for a very clear illustration to the students as
to who does what.</p></li>
<li><p>It is also effective to pair up students during this lesson and
assign one member of the pair to take the role of the owner and the
other the role of the collaborator. In this setup, challenges can
include asking the collaborator to make a change, commit it, and push
the change to the remote repository so that the owner can then retrieve
it, and vice-versa. The role playing between the instructors can get a
bit “dramatic” in the conflicts part of the lesson if the instructors
want to inject some humor into the room.</p></li>
<li><p>If you don’t have two projectors, have two instructors at the
front of the room. Each instructor does their piece of the collaboration
demonstration on their own computer and then passes the projector cord
back and forth with the other instructor when it’s time for them to do
the other part of the collaborative workflow. It takes less than 10
seconds for each switchover, so it doesn’t interrupt the flow of the
lesson. And of course it helps to give each of the instructors a
different-colored hat, or put different-colored sticky notes on their
foreheads.</p></li>
<li>
<p>If you’re the only instructor, the best way to create is clone
the two repos in your Desktop, but under different names, e.g., pretend
one is your computer at work:</p>
<div class="codewrapper sourceCode" id="cb2">
<h3 class="code-label">BASH<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="sourceCode bash" tabindex="0"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" tabindex="-1"></a><span class="ex">$</span> git clone https://github.com/alflin/recipes.git recipes-at-work</span></code></pre>
</div>
</li>
<li>
<p>It’s very common that learners mistype the remote alias or the
remote URL when adding a remote, so they cannot <code>push</code>. You
can diagnose this with <code>git remote -v</code> and checking carefully
for typos.</p>
<ul>
<li>To fix a wrong alias, you can do
<code>git remote rename <old> <new></code>.</li>
<li>To fix a wrong URL, you can do
<code>git remote set-url <alias> <newurl></code>.</li>
</ul>
</li>
<li><p>Before cloning the repo, be sure that nobody is inside another
repo. The best way to achieve this is moving to the <code>Desktop</code>
before cloning: <code>cd && cd Desktop</code>.</p></li>
<li>
<p>If both repos are in the <code>Desktop</code>, have them to clone
their collaborator repo under a given directory using a second
argument:</p>
<div class="codewrapper sourceCode" id="cb3">
<h3 class="code-label">BASH<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="sourceCode bash" tabindex="0"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" tabindex="-1"></a><span class="ex">$</span> git clone https://github.com/alflin/recipes.git alflin-recipes</span></code></pre>
</div>
</li>
<li><p>The most common mistake is that learners <code>push</code> before
<code>pull</code>ing. If they <code>pull</code> afterward, they may get
a conflict.</p></li>
<li><p>Conflicts, sometimes weird, will start to arise. Stay tight:
conflicts are next.</p></li>
<li><p>Learners may have slightly different output from
<code>git push</code> and <code>git pull</code> depending on the version
of git, and if upstream (<code>-u</code>) is used.</p></li>
</ul></section><section><h2 class="section-heading" id="conflicts">
<a href="09-conflict.html">Conflicts</a><a class="anchor" aria-label="anchor" href="#conflicts"></a>
</h2>
<hr class="half-width">
<ul>
<li><p>Expect the learners to make mistakes. Expect <em>yourself</em> to
make mistakes. This happens because it is late in the lesson and
everyone is tired.</p></li>
<li>
<p>If you’re the only instructor, the best way to create a conflict
is:</p>
<ul>
<li>Clone your repo in a different directory, pretending is your
computer at work:
<code>git clone https://github.com/alflin/recipes.git recipes-at-work</code>.</li>
<li>At the office, you make a change, commit and push.</li>
<li>At your laptop repo, you (forget to pull and) make a change, commit
and try to push.</li>
<li>
<code>git pull</code> now and show the conflict.</li>
</ul>
</li>
<li><p>Learners usually forget to <code>git add</code> the file after
fixing the conflict and just (try to) commit. You can diagnose this with
<code>git status</code>.</p></li>
<li>
<p>Remember that you can discard one of the two parents of the
merge:</p>
<ul>
<li>discard the remote file,
<code>git checkout --ours conflicted_file.txt</code>
</li>
<li>discard the local file,
<code>git checkout --theirs conflicted_file.txt</code>
</li>
</ul>
<p>You still have to <code>git add</code> and <code>git commit</code>
after this. This is particularly useful when working with binary
files.</p>
</li>
<li><p>Keep in mind that depending on the Git version used, the outputs
for <code>git push</code> and <code>git pull</code> can vary
slightly.</p></li>
</ul></section><section><h2 class="section-heading" id="open-science">
<a href="10-open.html">Open Science</a><a class="anchor" aria-label="anchor" href="#open-science"></a>
</h2>
<hr class="half-width"></section><section><h2 class="section-heading" id="licensing">
<a href="11-licensing.html">Licensing</a><a class="anchor" aria-label="anchor" href="#licensing"></a>
</h2>
<hr class="half-width">
<p>We teach about licensing because questions about who owns what, or
can use what, arise naturally once we start talking about using public
services like GitHub to store files. Also, the discussion gives learners
a chance to catch their breath after what is often a frustrating couple
of hours.</p>
<p>The Creative Commons family of licenses is recommended for many types
of works (including software documentation and images used in software)
but not software itself. Creative Commons <a href="https://creativecommons.org/faq/#can-i-apply-a-creative-commons-license-to-software" class="external-link">recommends</a>
a software-specific license instead.</p>
</section><section><h2 class="section-heading" id="citation">
<a href="12-citation.html">Citation</a><a class="anchor" aria-label="anchor" href="#citation"></a>
</h2>
<hr class="half-width"></section><section><h2 class="section-heading" id="hosting">
<a href="13-hosting.html">Hosting</a><a class="anchor" aria-label="anchor" href="#hosting"></a>
</h2>
<hr class="half-width">
<p>A common concern for learners is having their work publicly available
on GitHub. While we encourage open science, sometimes private repos are
the only choice. It’s always interesting to mention the options to have
web-hosted private repositories.</p>
</section><section id="aggregate-instructor-notes"></section>
</div>
</main>
</div>
<!-- END : inst/pkgdown/templates/content-extra.html -->
</div>
<!--/div.row-->
<footer class="row footer mx-md-3"><hr>
<div class="col-md-6">
<p>This lesson is subject to the <a href="CODE_OF_CONDUCT.html">Code of Conduct</a></p>
<p>
<a href="https://github.com/swcarpentry/git-novice/edit/main/README.md" class="external-link">Edit on GitHub</a>
| <a href="https://github.com/swcarpentry/git-novice/blob/main/CONTRIBUTING.md" class="external-link">Contributing</a>
| <a href="https://github.com/swcarpentry/git-novice/" class="external-link">Source</a></p>
<p><a href="https://github.com/swcarpentry/git-novice/blob/main/CITATION" class="external-link">Cite</a> | <a href="mailto:[email protected]">Contact</a> | <a href="https://carpentries.org/about/" class="external-link">About</a></p>
</div>
<div class="col-md-6">
<p>Materials licensed under <a href="LICENSE.html">CC-BY 4.0</a> by the authors</p>
<p>Template licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/" class="external-link">CC-BY 4.0</a> by <a href="https://carpentries.org/" class="external-link">The Carpentries</a></p>
<p>Built with <a href="https://github.com/carpentries/sandpaper/tree/0.16.10" class="external-link">sandpaper (0.16.10)</a>, <a href="https://github.com/carpentries/pegboard/tree/0.7.7" class="external-link">pegboard (0.7.7)</a>, and <a href="https://github.com/carpentries/varnish/tree/1.0.5" class="external-link">varnish (1.0.5)</a></p>
</div>
</footer>
</div> <!-- / div.container -->
<div id="to-top">
<a href="#top">
<i class="search-icon" data-feather="arrow-up" role="img" aria-label="Back To Top"></i><br><!-- <span class="d-none d-sm-none d-md-none d-lg-none d-xl-block">Back</span> To Top --><span class="d-none d-sm-none d-md-none d-lg-none d-xl-block">Back</span> To Top
</a>
</div>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "TrainingMaterial",
"@id": "https://swcarpentry.github.io/git-novice/instructor-notes.html",
"inLanguage": "en",
"dct:conformsTo": "https://bioschemas.org/profiles/TrainingMaterial/1.0-RELEASE",
"description": "A Carpentries Lesson teaching foundational data and coding skills to researchers worldwide",
"keywords": "software, data, lesson, The Carpentries",
"name": "Instructor Notes",
"creativeWorkStatus": "active",
"url": "https://swcarpentry.github.io/git-novice/instructor-notes.html",
"identifier": "https://swcarpentry.github.io/git-novice/instructor-notes.html",
"dateCreated": "2014-12-04",
"dateModified": "2024-12-17",
"datePublished": "2024-12-17"
}
</script><script>
feather.replace();
</script><!-- Matomo --><script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
_paq.push(["setDomains", ["*.lessons.carpentries.org","*.datacarpentry.github.io","*.datacarpentry.org","*.librarycarpentry.github.io","*.librarycarpentry.org","*.swcarpentry.github.io", "*.carpentries.github.io"]]);
_paq.push(["setDoNotTrack", true]);
_paq.push(["disableCookies"]);
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function() {
var u="https://matomo.carpentries.org/";
_paq.push(["setTrackerUrl", u+"matomo.php"]);
_paq.push(["setSiteId", "1"]);
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
g.async=true; g.src="https://matomo.carpentries.org/matomo.js"; s.parentNode.insertBefore(g,s);
})();
</script><!-- End Matomo Code -->
</body>
</html><!-- END: inst/pkgdown/templates/layout.html-->