forked from LibraryCarpentry/lc-git
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path03-sharing.html
911 lines (868 loc) · 50.7 KB
/
03-sharing.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
899
900
901
902
903
904
905
906
907
908
909
910
<!DOCTYPE html>
<!-- START: inst/pkgdown/templates/layout.html --><!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><title>Library Carpentry: Introduction to Git: Sharing your work</title><meta name="viewport" content="width=device-width, initial-scale=1"><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="apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"><link rel="manifest" href="site.webmanifest"><link rel="mask-icon" href="safari-pinned-tab.svg" color="#5bbad5"><meta name="msapplication-TileColor" content="#da532c"><meta name="theme-color" content="#ffffff"></head><body>
<header id="top" class="navbar navbar-expand-md navbar-light bg-white top-nav library"><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-6">
<div class="large-logo">
<img alt="Library Carpentry" src="assets/images/library-logo.svg"></div>
</div>
<div class="selector-container">
<div class="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/03-sharing.html';">Instructor View</button></li>
</ul></div>
</div>
</div>
<hr></header><nav class="navbar navbar-expand-xl navbar-light bg-white bottom-nav library" 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="Library Carpentry" src="assets/images/library-logo-sm.svg"></div>
<div class="lesson-title-md">
Library Carpentry: Introduction to Git
</div>
<div class="search-icon-sm">
<!-- TODO: do not show until we have search
<i role="img" aria-label="search button" 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">
Library Carpentry: Introduction to 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">FIXME</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="Search" aria-label="Search"><button class="btn btn-outline-success tablet-search-button" type="submit">
<i class="search-icon" data-feather="search" role="img" aria-label="search button"></i>
</button>
</fieldset></form>
</div><!--/div.container-fluid -->
</nav><div class="col-md-12 mobile-title">
Library Carpentry: Introduction to Git
</div>
<aside class="col-md-12 lesson-progress"><div style="width: 21%" class="percentage">
21%
</div>
<div class="progress library">
<div class="progress-bar library" role="progressbar" style="width: 21%" aria-valuenow="21" 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">
<i class="search-icon" data-feather="x" role="img"></i>
</button>
<div class="sidebar-inner">
<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/03-sharing.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-what-is-git.html">1. What is Git/GitHub?</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-getting-started.html">2. Getting started with Git</a>
</div><!--/div.accordion-header-->
</div><!--/div.accordion-item-->
</div><!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlushcurrent">
<div class="accordion-item">
<div class="accordion-header" id="flush-headingcurrent">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapsecurrent" aria-expanded="true" aria-controls="flush-collapsecurrent">
<span class="visually-hidden">Current Chapter</span>
<span class="current-chapter">
3. Sharing your work
</span>
</button>
</div><!--/div.accordion-header-->
<div id="flush-collapsecurrent" class="accordion-collapse collapse show" aria-labelledby="flush-headingcurrent" data-bs-parent="#accordionFlushcurrent">
<div class="accordion-body">
<ul><li><a href="#the-power-of-sharing">The power of sharing</a></li>
<li><a href="#create-a-repository-on-github">Create a repository on GitHub</a></li>
<li><a href="#connecting-your-local-repository-to-the-github-repository">Connecting your local repository to the GitHub repository</a></li>
<li><a href="#ssh-background-and-setup">SSH Background and Setup</a></li>
<li><a href="#pushing-changes">Pushing changes</a></li>
<li><a href="#pushing-changes-again">Pushing changes (again)</a></li>
<li><a href="#pulling-changes">Pulling changes</a></li>
</ul></div><!--/div.accordion-body-->
</div><!--/div.accordion-collapse-->
</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-review.html">4. Review</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-github-pages.html">5. GitHub Pages</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 resources" id="accordionFlush12">
<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingTwelve">
<button class="accordion-button collapsed" id="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">FIXME</a></li>
</ul></div>
</div>
</div>
</div>
<hr class="half-width 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-instructor.html -->
<div class="col-xl-8 col-lg-12 primary-content">
<nav class="lesson-content mx-md-4" aria-label="Previous and Next Chapter"><!-- content for small screens --><div class="d-block d-sm-block d-md-none">
<a class="chapter-link" href="02-getting-started.html"><i aria-hidden="true" class="small-arrow" data-feather="arrow-left"></i>Previous</a>
<a class="chapter-link float-end" href="04-review.html">Next<i aria-hidden="true" class="small-arrow" data-feather="arrow-right"></i></a>
</div>
<!-- content for large screens -->
<div class="d-none d-sm-none d-md-block">
<a class="chapter-link" href="02-getting-started.html" rel="prev">
<i aria-hidden="true" class="small-arrow" data-feather="arrow-left"></i>
Previous: Getting started with
</a>
<a class="chapter-link float-end" href="04-review.html" rel="next">
Next: Review...
<i aria-hidden="true" class="small-arrow" data-feather="arrow-right"></i>
</a>
</div>
<hr></nav><main id="main-content" class="main-content"><div class="container lesson-content">
<h1>Sharing your work</h1>
<p> Last updated on 2023-04-21 |
<a href="https://github.com/librarycarpentry/lc-git/edit/main/episodes/03-sharing.md" class="external-link">Edit this page <i aria-hidden="true" data-feather="edit"></i></a></p>
<div class="text-end">
<button role="button" aria-pressed="false" tabindex="0" id="expand-code" class="pull-right"> Expand All Solutions <i aria-hidden="true" data-feather="plus"></i></button>
</div>
<div class="overview card">
<h2 class="card-header">Overview</h2>
<div class="row g-0">
<div class="col-md-4">
<div class="card-body">
<div class="inner">
<h3 class="card-title">Questions</h3>
<ul><li>How can I use Git and GitHub to share my work?</li>
<li>How do I link a local Git repository to GitHub?</li>
<li>How do I move changes between a local Git repository and a GitHub
repository?</li>
<li>How can I see the differences between my current file and my most
recent commit?</li>
</ul></div>
</div>
</div>
<div class="col-md-8">
<div class="card-body">
<div class="inner bordered">
<h3 class="card-title">Objectives</h3>
<ul><li>create a remote repository on GitHub</li>
<li>link a local Git repository to a remote GitHub repository</li>
<li>move changes between the local and remote repositories using
<code>push</code> and <code>pull</code>
</li>
<li>examine the difference between an edited file and the file’s most
recently committed version</li>
</ul></div>
</div>
</div>
</div>
</div>
<section id="the-power-of-sharing"><h2 class="section-heading">The power of sharing<a class="anchor" aria-label="anchor" href="#the-power-of-sharing"></a>
</h2>
<hr class="half-width"><p>The real power of Git lies in being able to share your work with
others and in being able to work collaboratively. The best way to do
this is to use a remote hosting platform. For this lesson, we are using
GitHub. Let’s log in there now.</p>
</section><section id="create-a-repository-on-github"><h2 class="section-heading">Create a repository on GitHub<a class="anchor" aria-label="anchor" href="#create-a-repository-on-github"></a>
</h2>
<hr class="half-width"><p>Once we have logged in to GitHub, we can create a new repository by
clicking the <strong>+</strong> icon in the upper-right corner of any
page then selecting <strong>New repository</strong>. Let’s do this
now.</p>
<figure><img src="fig/github-repo-new.png" alt="The GitHub website top navigation with the 'add new ...' button." class="figure mx-auto d-block"></figure><ul><li>Click “New Repository”</li>
</ul><p>Clicking <code>New Repository</code> will take you to a creation page
with different options. For this workshop, we are not using any of the
options available.</p>
<ul><li>Name your repository “hello-world.”</li>
</ul><figure><img src="fig/github-repo-new-setup_copy.png" class="image-with-shadow figure mx-auto d-block" alt="The 'create a new repository' form on GitHub"></figure><p>GitHub will ask if you want to add a README.md, license or a
<code>.gitignore</code> file. Do not do any of that for now – We want
you to start with a completely empty repository on GitHub.</p>
<ul><li>Click <code>Create Repository</code> button.</li>
</ul><div id="choosing-a-license" class="callout callout">
<div class="callout-square">
<i class="callout-icon" data-feather="bell"></i>
</div>
<div id="choosing-a-license" class="callout-inner">
<h3 class="callout-title">Choosing a license<a class="anchor" aria-label="anchor" href="#choosing-a-license"></a>
</h3>
<div class="callout-content">
<p>When you are ready to use GitHub to host your own work, you should
review the different license options. Choosing a license is an important
part of openly sharing your creative and research work online. For help
in wading through the many types of open source licenses, please visit
<a href="https://choosealicense.com/" class="external-link">https://choosealicense.com/</a>.</p>
</div>
</div>
</div>
</section><section id="connecting-your-local-repository-to-the-github-repository"><h2 class="section-heading">Connecting your local repository to the GitHub repository<a class="anchor" aria-label="anchor" href="#connecting-your-local-repository-to-the-github-repository"></a>
</h2>
<hr class="half-width"><p>The next page that GitHub displays contains some information to help
you connect your repository on GitHub with your local repository (on
your own computer). To make this connection, we want to tell our local
repository that GitHub is the <code>remote</code> repository. In order
to do that we need the information that GitHub displays in the “Quick
setup” box on this page.</p>
<p>We will use the Secure Shell (SSH) protocol for this lesson, so
please make sure that button shows that it is selected (gray highlight)
and that the address in the text box starts with <a href="mailto:git@github" class="email">git@github</a>. It will look
something like this:</p>
<figure><img src="fig/github-repo-connect.png" alt="The repository set up page in GitHub showing the SSH address to use." class="figure mx-auto d-block"></figure><div id="https-vs.-ssh" class="callout callout">
<div class="callout-square">
<i class="callout-icon" data-feather="bell"></i>
</div>
<div id="https-vs.-ssh" class="callout-inner">
<h3 class="callout-title">HTTPS vs. SSH<a class="anchor" aria-label="anchor" href="#https-vs.-ssh"></a>
</h3>
<div class="callout-content">
<p>We use SSH here because, while it requires some additional
configuration, it is a security protocol widely used by many
applications. The steps below describe SSH at a minimum level for
GitHub.</p>
</div>
</div>
</div>
<!--- A supplemental episode to this lesson discusses advanced setup, concepts of SSH and key pairs, and other material supplemental to git related SSH.--->
<p>In the previous episode we created a local repository on our own
computer. Now we have also created a remote repository on GitHub. But at
this point, the two are completely isolated from each other. We want to
link them together to synchronize them and share our project with the
world.</p>
<p>To connect the repository on our own computer (local) to the
repository we just created on GitHub, we will use the commands provided
by GitHub in the box with the heading “…or push an existing repository
from the command line.”</p>
<figure><img src="fig/github-instructions.png" alt="GitHub instructions" class="figure mx-auto d-block"></figure><p>Let’s use these instructions now. Move back to your shell application
and enter the first command:</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" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> git remote add origin [email protected]:yourname/hello-world.git </span></code></pre>
</div>
<p>Make sure to use the URL for your actual repository user name rather
than <code>yourname</code>: the only difference should be your username
instead of <code>yourname</code>.</p>
<p>Let’s breakdown the elements of the command. All commands related to
Git in the shell start by invoking the Git language by typing
<code>git</code> at the start. <code>remote add</code> is the command in
the Git language we use to configure a remote repository, e.g., another
Git repository that contains the same content as our local repository,
but that is not on our computer. <code>origin</code> is the nickname
we’re telling our local machine to use to for the following long web
address. After we enter this command, we can use <code>origin</code> to
refer to this specific repository in GitHub instead of the URL.</p>
<p>We can check that it is set up correctly with the command:</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" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> git remote <span class="at">-v</span></span></code></pre>
</div>
<div class="codewrapper">
<h3 class="code-label">OUTPUT<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="output" tabindex="0"><code>origin [email protected]:<your_github_username>/hello-world.git (fetch)
origin [email protected]:<your_github_username>/hello-world.git (push)</code></pre>
</div>
</section><section id="ssh-background-and-setup"><h2 class="section-heading">SSH Background and Setup<a class="anchor" aria-label="anchor" href="#ssh-background-and-setup"></a>
</h2>
<hr class="half-width"><p>We still need to do a little more setup before we can actually
connect to this remote repository. We need to set up a way for our local
computer to authenticate with GitHub so that GitHub recognizes our
computer as belonging to the same person who owns the GitHub
repository.</p>
<p>We will use SSH as our authentication method. SSH stands for Secure
SHell protocol. SSH is a cryptographic network protocol that allows
secure communication between computers using an otherwise insecure
network.</p>
<p>SSH uses what is called a key pair – two keys that work together to
validate access. One key is used publicly (the public key) and the other
key is kept private (the private key).</p>
<p>You can think of the public key as a padlock, and only you have the
key (the private key) to open it. You use the public key where you want
a secure method of communication, such as your GitHub account. You give
this padlock, or public key, to GitHub and say “lock the communications
to my account with this so that only computers that have my private key
can unlock communications and send Git commands as my GitHub
account.”</p>
<p>What we will do now is the minimum required to set up the SSH keys
and add the public key to a GitHub account. I’m not going to lie, this
is a bit tedious and confusing. But you have to do it to get to the fun
part, so hang in there.</p>
<!-- > ## Advanced SSH -->
<!-- > A supplemental episode in this lesson discusses SSH and key pairs in more depth and detail.-->
<!-- {: .callout}-->
<p>The first thing we are going to do is check if this has already been
done on the computer you’re on.</p>
<div id="keeping-your-keys-secure" class="callout callout">
<div class="callout-square">
<i class="callout-icon" data-feather="bell"></i>
</div>
<div id="keeping-your-keys-secure" class="callout-inner">
<h3 class="callout-title">Keeping your keys secure<a class="anchor" aria-label="anchor" href="#keeping-your-keys-secure"></a>
</h3>
<div class="callout-content">
<p>You shouldn’t really forget about your SSH keys, since they keep your
account secure. It’s good practice to audit your secure shell keys every
so often. Especially if you are using multiple computers to access your
account.</p>
</div>
</div>
</div>
<p>We will run the list command (<code>ls</code>) to check what key
pairs already exist on your computer. In our command we use the
<code>~</code> as the shorthand for “my home directory.”</p>
<div class="codewrapper sourceCode" id="cb4">
<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="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ls</span> <span class="at">-al</span> ~/.ssh</span></code></pre>
</div>
<p>Your output is going to look a little different depending on whether
or not SSH has ever been set up on the computer you are using.</p>
<p>If you have not set up SSH, your output might look like this:</p>
<div class="codewrapper">
<h3 class="code-label">OUTPUT<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="output" tabindex="0"><code>ls: cannot access '/c/Users/YourName/.ssh': No such file or directory</code></pre>
</div>
<p>If SSH has been set up on the computer you’re using, the public and
private key pairs will be listed. The file names are either
<code>id_ed25519</code>/<code>id_ed25519.pub</code> or
<code>id_rsa</code>/<code>id_rsa.pub</code> depending on how the key
pairs were set up.</p>
<p>If you do not have SSH set up, let’s set it up now. Use this command
to create key pairs:</p>
<div class="codewrapper sourceCode" id="cb6">
<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="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> ssh-keygen <span class="at">-t</span> ed25519 <span class="at">-C</span> <span class="st">"[email protected]"</span></span></code></pre>
</div>
<div class="codewrapper">
<h3 class="code-label">OUTPUT<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="output" tabindex="0"><code>Generating public/private ed25519 key pair.
Enter file in which to save the key (/c/Users/YourName/.ssh/id_ed25519):</code></pre>
</div>
<p>We want to use the default file, so just press <kbd>Enter</kbd>.</p>
<div class="codewrapper">
<h3 class="code-label">OUTPUT<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="output" tabindex="0"><code>Created directory '/c/Users/YourName/.ssh'.
Enter passphrase (empty for no passphrase):</code></pre>
</div>
<p>Your computer is now asking you for a passphrase to protect this SSH
key pair. We recommend that you use a passphrase and that you make a
note of it. There is no “reset my password” option for this setup. If
you forget your passphrase, you have to delete your existing key pair
and do this setup again. It’s not a big deal, but easier if you don’t
have to repeat it.</p>
<div class="codewrapper">
<h3 class="code-label">OUTPUT<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="output" tabindex="0"><code>Enter same passphrase again:</code></pre>
</div>
<p>After entering the same passphrase a second time, you will receive
the confirmation</p>
<div class="codewrapper">
<h3 class="code-label">OUTPUT<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="output" tabindex="0"><code>Your identification has been saved in /c/Users/YourName/.ssh/id_ed25519
Your public key has been saved in /c/Users/YourName/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:SMSPIStNyA00KPxuYu94KpZgRAYjgt9g4BA4kFy3g1o [email protected]
The key's randomart image is:
+--[ED25519 256]--+
|^B== o. |
|%*=.*.+ |
|+=.E =.+ |
| .=.+.o.. |
|.... . S |
|.+ o |
|+ = |
|.o.o |
|oo+. |
+----[SHA256]-----+</code></pre>
</div>
<p>The “identification” is actually the private key. You should never
share it. The public key is appropriately named. The “key fingerprint”
is a shorter version of a public key.</p>
<p>Now that we have generated the SSH keys, we will find the SSH files
when we check.</p>
<div class="codewrapper sourceCode" id="cb11">
<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="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ls</span> <span class="at">-al</span> ~/.ssh</span></code></pre>
</div>
<div class="codewrapper">
<h3 class="code-label">OUTPUT<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="output" tabindex="0"><code>drwxr-xr-x 1 YourName 197121 0 Jul 16 14:48 ./
drwxr-xr-x 1 YourName 197121 0 Jul 16 14:48 ../
-rw-r--r-- 1 YourName 197121 419 Jul 16 14:48 id_ed25519
-rw-r--r-- 1 YourName 197121 106 Jul 16 14:48 id_ed25519.pub</code></pre>
</div>
<p>Now we need to give our public key (the padlock) over to GitHub.</p>
<p>First, we need to copy the public key. Be sure to include the
<code>.pub</code> at the end, otherwise you’re looking at the private
key.</p>
<div class="codewrapper sourceCode" id="cb13">
<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="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> ~/.ssh/id_ed25519.pub</span></code></pre>
</div>
<div class="codewrapper">
<h3 class="code-label">OUTPUT<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="output" tabindex="0"><code>ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDmRA3d51X0uu9wXek559gfn6UFNF69yZjChyBIU2qKI [email protected]</code></pre>
</div>
<p>Copy that entire line of output, and we will paste the copied text
into GitHub in the next step.</p>
<p>Now, going to GitHub.com, click on your profile icon in the top right
corner to get the drop-down menu. Click “Settings,” then on the settings
page, click “SSH and GPG keys,” on the left side “Account settings”
menu. Click the “New SSH key” button on the right side. Now, you can add
the title (A person might use the title “My 2021 work laptop,” just a
little description to remind themselves which computer this public key
connect to). Paste your SSH key into the field, and click the “Add SSH
key” to complete the setup.</p>
<p>Now that we’ve set that up, let’s check our authentication from the
command line.</p>
<div class="codewrapper sourceCode" id="cb15">
<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="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> ssh <span class="at">-T</span> [email protected]</span></code></pre>
</div>
<div class="codewrapper">
<h3 class="code-label">OUTPUT<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="output" tabindex="0"><code>Hi YourName! You've successfully authenticated, but GitHub does not provide shell access.</code></pre>
</div>
</section><section id="pushing-changes"><h2 class="section-heading">Pushing changes<a class="anchor" aria-label="anchor" href="#pushing-changes"></a>
</h2>
<hr class="half-width"><p>Now we have established a connection between the two repositories,
but we still haven’t synchronized their content, so the remote
repository is still empty. To fix that, we will have to “push” our local
changes to the GitHub repository. We do this using the
<code>git push</code> command:</p>
<div class="codewrapper sourceCode" id="cb17">
<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="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> git push <span class="at">-u</span> origin main</span></code></pre>
</div>
<div class="codewrapper">
<h3 class="code-label">OUTPUT<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="output" tabindex="0"><code>Counting objects: 3, done.
Writing objects: 100% (3/3), 226 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/<your_github_username/hello-world
* [new branch] main -> main
Branch main set up to track remote branch main from origin.</code></pre>
</div>
<p>The nickname of our remote repository is “origin” and the default
local branch name is “main”. The <code>-u</code> flag tells git to
remember the parameters, so that next time we can simply run
<code>git push</code> and Git will know what to do.</p>
<p>Pushing our local changes to the Github repository is sometimes
referred to as “pushing changes <code>upstream</code> to Github”. The
word <code>upstream</code> here comes from the git flag we used earlier
in the command <code>git push -u origin main</code>. The flag
<code>-u</code> refers to <code>-set-upstream</code>, so when we say
pushing changes upstream, it refers to the remote repository.</p>
<p>You may be prompted to enter your GitHub username and password to
complete the command.</p>
<p>When we do a <code>git push</code>, we will see Git ‘pushing’ changes
upstream to GitHub. Because our file is very small, this won’t take long
but if we had made a lot of changes or were adding a very large
repository, we might have to wait a little longer. We can check where
we’re at with <code>git status</code>.</p>
<div class="codewrapper sourceCode" id="cb19">
<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="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> git status</span></code></pre>
</div>
<div class="codewrapper">
<h3 class="code-label">OUTPUT<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="output" tabindex="0"><code>On branch main
Your branch is up-to-date with 'origin/main'.
nothing to commit, working tree clean</code></pre>
</div>
<p>This output lets us know where we are working (the main branch). We
can also see that we have no changes to commit and everything is in
order.</p>
<p>We can use the <code>git diff</code> command to see changes we have
made before making a commit. Open index.md with any text editor and
enter some text on a new line, for instance “A new line” or something
else. We will then use <code>git diff</code> to see the changes we
made:</p>
<div class="codewrapper sourceCode" id="cb21">
<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="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> git diff</span></code></pre>
</div>
<div class="codewrapper">
<h3 class="code-label">OUTPUT<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="output" tabindex="0"><code>diff --git a/index.md b/index.md
index aed0629..989787e 100644
--- a/index.md
+++ b/index.md
@@ -1 +1,2 @@
-# Hello, world!
\ No newline at end of file
+# Hello, world!
+A new line</code></pre>
</div>
<p>The command produces lots of information and it can be a bit
overwhelming at first, but let’s go through some key information
here:</p>
<ol style="list-style-type: decimal"><li>The first line tells us that Git is producing output similar to the
Unix <code>diff</code> command, comparing the old and new versions of
the file.</li>
<li>The second line tells exactly which versions of the file Git is
comparing; <code>aed0629</code> and <code>989787e</code> are unique
computer-generated identifiers for those versions.</li>
<li>The third and fourth lines once again show the name of the file
being changed.</li>
<li>The remaining lines are the most interesting; they show us the
actual differences and the lines on which they occur. In particular, the
+ markers in the first column show where we have added lines.</li>
</ol><p>We can now commit these changes:</p>
<div class="codewrapper sourceCode" id="cb23">
<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="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> git add index.md</span>
<span id="cb23-2"><a href="#cb23-2" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> git commit <span class="at">-m</span> <span class="st">'Add another line'</span></span></code></pre>
</div>
<p>If we are very forgetful and have already forgotten what we changed,
<code>git log</code> allows us to look at what we have been doing with
our git repository (in reverse chronological order, with the very latest
changes first).</p>
<div class="codewrapper sourceCode" id="cb24">
<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="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> git log</span></code></pre>
</div>
<div class="codewrapper">
<h3 class="code-label">OUTPUT<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="output" tabindex="0"><code>commit 8e2eb9920eaa0bf18a4adfa12474ad58b765fd06
Author: Your Name <your_email>
Date: Mon Jun 5 12:41:45 2017 +0100
Add another line
commit e9e8fd3f12b64fc3cbe8533e321ef2cdb1f4ed39
Author: Your Name <your_email>
Date: Fri Jun 2 18:15:43 2017 +0100
Add index.md</code></pre>
</div>
<p>This shows us the two commits we have made and shows the messages we
wrote. It is important to try to use meaningful commit messages when we
make changes. This is especially important when we are working with
other people who might not be able to guess as easily what our short
cryptic messages might mean. Note that it is best practice to always
write commit messages in the imperative (e.g. ‘Add index.md’, rather
than ‘Adding index.md’).</p>
</section><section id="pushing-changes-again"><h2 class="section-heading">Pushing changes (again)<a class="anchor" aria-label="anchor" href="#pushing-changes-again"></a>
</h2>
<hr class="half-width"><p>Now, let’s have a look at the repository at GitHub again (that is,
<code>https://github.com/some-librarian/hello-world</code> with
<code>some-librarian</code> replaced with your username). We see that
the <code>index.md</code> file is there, but there is only one
commit:</p>
<figure><img src="fig/github-one-commit.png" alt="Only one commit on GitHub" class="figure mx-auto d-block"></figure><p>And if you click on <code>index.md</code> you will see that it
contains the “Hello, world!” header, but not the new line we just
added.</p>
<p>This is because we haven’t yet pushed our local changes to the remote
repository. This might seem like a mistake in design but it is often
useful to make a lot of commits for small changes so you are able to
make careful revisions later and you don’t necessarily want to push all
these changes one by one.</p>
<p>Another benefit of this design is that you can make commits without
being connected to internet.</p>
<p>But let’s push our changes now, using the <code>git push</code>
command:</p>
<div class="codewrapper sourceCode" id="cb26">
<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="cb26-1"><a href="#cb26-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> git push</span></code></pre>
</div>
<div class="codewrapper">
<h3 class="code-label">OUTPUT<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="output" tabindex="0"><code>Counting objects: 3, done.
Writing objects: 100% (3/3), 272 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/<your_github_username>/hello-world
e9e8fd3..8e2eb99 main -> main</code></pre>
</div>
<p>And let’s check on GitHub that we now have 2 commits there.</p>
</section><section id="pulling-changes"><h2 class="section-heading">Pulling changes<a class="anchor" aria-label="anchor" href="#pulling-changes"></a>
</h2>
<hr class="half-width"><p>When working with others, or when we’re making our own changes from
different machines, we need a way of pulling those remote changes back
into our local copy. For now, we can see how this works by making a
change on the GitHub website and then ‘pulling’ that change back to our
computer.</p>
<p>Let’s go to our repository in GitHub and make a change. Underneath
where our index.md file is listed you will see a button to ‘Add a
README’. Do this now, entering whatever you like, scrolling to the
bottom and clicking ‘Commit new file’ (The default commit message will
be ‘Create README.md’, which is fine for our purposes).</p>
<div id="the-readme-file" class="callout callout">
<div class="callout-square">
<i class="callout-icon" data-feather="bell"></i>
</div>
<div id="the-readme-file" class="callout-inner">
<h3 class="callout-title">The README file<a class="anchor" aria-label="anchor" href="#the-readme-file"></a>
</h3>
<div class="callout-content">
<p>It is good practice to add a README file to each project to give a
brief overview of what the project is about. If you put your README file
in your repository’s root directory, GitHub will recognize and
automatically surface your README to repository visitors</p>
</div>
</div>
</div>
<p>Our local repository is now out of sync with our remote repository,
so let’s fix that by pulling the remote changes into our local
repository using the <code>git pull</code> command.</p>
<div class="codewrapper sourceCode" id="cb28">
<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="cb28-1"><a href="#cb28-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> git pull</span></code></pre>
</div>
<div class="codewrapper">
<h3 class="code-label">OUTPUT<i aria-hidden="true" data-feather="chevron-left"></i><i aria-hidden="true" data-feather="chevron-right"></i>
</h3>
<pre class="output" tabindex="0"><code>remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/<your_github_username>/hello-world
8e2eb99..0f5a7b0 main -> origin/main
Updating 8e2eb99..0f5a7b0
Fast-forward
README.md | 1 +
1 file changed, 1 insertion(+)
create mode 100644 README.md</code></pre>
</div>
<p>The above output shows that we have fast-forwarded our local
repository to include the file README.md. We could confirm this by
entering the <code>ls</code> command.</p>
<p>When we begin collaborating on more complex projects, we may have to
consider more aspects of git functionality, but this should be a good
start. In the next section, we can look more closely at collaborating
and using GitHub pages to create a website for our project.</p>
<div id="keypoints1" class="callout keypoints">
<div class="callout-square">
<i class="callout-icon" data-feather="key"></i>
</div>
<div class="callout-inner">
<h3 class="callout-title">Keypoints<a class="anchor" aria-label="anchor" href="#keypoints1"></a>
</h3>
<div class="callout-content">
<ul><li>remote repositories on GitHub help you collaborate and share your
work</li>
<li>
<code>push</code> is a Git verb for sending changes from the local
repository to a remote repository</li>
<li>
<code>pull</code> is a Git verb for bringing changes from a remote
repository to the local repository</li>
<li>
<code>diff</code> is a Git verb for viewing the difference between
an edited file and the file’s most recent commit</li>
</ul></div>
</div>
</div>
</section></div> <!-- / div.lesson-content -->
</main><!-- / main#main-content.main-content --><nav class="bottom-pagination mx-md-4" aria-label="Previous and Next Chapter"><div class="d-block d-sm-block d-md-none">
<a class="chapter-link" href="02-getting-started.html"><i aria-hidden="true" class="small-arrow" data-feather="arrow-left"></i>Previous</a>
<a class="chapter-link float-end" href="04-review.html">Next<i aria-hidden="true" class="small-arrow" data-feather="arrow-right"></i></a>
</div>
<!-- content for large screens -->
<div class="d-none d-sm-none d-md-block">
<a class="chapter-link" href="02-getting-started.html" rel="prev">
<i aria-hidden="true" class="small-arrow" data-feather="arrow-left"></i>
Previous: Getting started with
</a>
<a class="chapter-link float-end" href="04-review.html" rel="next">
Next: Review...
<i aria-hidden="true" class="small-arrow" data-feather="arrow-right"></i>
</a>
</div>
</nav></div> <!-- / div.primary-content.col-xs-12 -->
<!-- END: inst/pkgdown/templates/content-instructor.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/librarycarpentry/lc-git/edit/main/episodes/03-sharing.md" class="external-link">Edit on GitHub</a>
| <a href="https://github.com/librarycarpentry/lc-git/blob/main/CONTRIBUTING.md" class="external-link">Contributing</a>
| <a href="https://github.com/librarycarpentry/lc-git/" class="external-link">Source</a></p>
<p><a href="https://github.com/librarycarpentry/lc-git/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><a href="https://creativecommons.org/licenses/by-sa/4.0/" class="external-link">Template licensed under 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.13.0" class="external-link">sandpaper (0.13.0)</a>,
<a href="https://github.com/carpentries/pegboard/tree/0.6.1" class="external-link">pegboard (0.6.1)</a>,
and <a href="https://github.com/carpentries/varnish/tree/0.3.0" class="external-link">varnish (0.3.0)</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
</a>
</div>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "TrainingMaterial",
"@id": "https://librarycarpentry.github.io/lc-git/03-sharing.html",
"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": "Sharing your work",
"creativeWorkStatus": "active",
"url": "https://librarycarpentry.github.io/lc-git/03-sharing.html",
"identifier": "https://librarycarpentry.github.io/lc-git/03-sharing.html",
"dateCreated": "2018-04-12",
"dateModified": "2023-04-21",
"datePublished": "2023-09-19"
}
</script><script>
feather.replace();
</script><!-- Matomo
2022-11-07: we have gotten a notification that we have an overage for our
tracking and I'm pretty sure this has to do with Workbench usage.
Considering that I am not _currently_ using this tracking because I do not
yet know how to access the data, I am turning this off for now.
<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", ["*.preview.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://carpentries.matomo.cloud/";
_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://cdn.matomo.cloud/carpentries.matomo.cloud/matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
End Matomo Code --></body></html><!-- END: inst/pkgdown/templates/layout.html-->