forked from girldevelopit/gdi-featured-git-github
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
734 lines (671 loc) · 27.4 KB
/
index.html
File metadata and controls
734 lines (671 loc) · 27.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Intro to Git and Github ~ Girl Develop It</title>
<meta name="description" content="This is the official Girl Develop It Core Intro to Git and GitHub course. Material based on original material by Kim Moir, Daniel Fischer, Aurelia Moser, Carina C. Zona and Izzy Johnston.
The course is meant to be taught in a two-hour workshop. Each of the slides and practice files are customizable according to the needs of a given class or audience.">
<meta name="author" content="Girl Develop It">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/simple.css" id="theme">
<!-- For syntax highlighting -->
<!-- light editor <link rel="stylesheet" href="lib/css/light.css">-->
<!-- dark editor-->
<link rel="stylesheet" href="lib/css/dark.css">
<!-- <link rel="stylesheet" href="lib/css/zenburn.css"> -->
<link rel="stylesheet" href="plugin/accessibility-helper/css/accessibility-helper.css">
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
<script>
if (window.location.search.match(/print-pdf/gi)) {
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'css/print/pdf.css';
document.getElementsByTagName('head')[0].appendChild(link);
}
</script>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<!-- Opening slide -->
<section>
<img src="images/circle-gdi-logo.png" alt="Girl Develop It" class="noborder" />
<h3>Intro to Git and Github</h3>
</section>
<!-- Welcome-->
<section>
<h3>Welcome!</h3>
<div class="left-align">
<p>Girl Develop It is here to provide affordable and accessible programs to learn software through mentorship and hands-on instruction.</p>
<p class="green">Some "rules"</p>
<ul>
<li>We are here for you!</li>
<li>Every question is important</li>
<li>Help each other</li>
<li>Have fun</li>
</ul>
</div>
</section>
<section>
<h3>Welcome!</h3>
<div class="left-align">
<p class="blue">Tell us about yourself.</p>
<ul>
<li>Who are you?</li>
<li>What do you hope to get out of the class?</li>
</ul>
</div>
</section>
<section>
<h3>What we will cover today</h3>
<ul>
<li class="fragment">What is version control and why should we care?</li>
<li class="fragment">Basics of Git: the essential commands</li>
<li class="fragment">GitHub (or, a little Git between friends)</li>
</ul>
</section>
<!-- Version control-->
<section>
<h3>What is version control?</h3>
<p>Version control allows you (and your team) to…</p>
<div class="fragment">
<h4>Collaborate</h4>
<p>Create anything with other people, from academic papers to entire websites and applications.</p>
</div>
<div class="fragment">
<h4>Track and revert changes</h4>
<p>Mistakes happen. Wouldn't it be nice if you could see the changes that have been made and go "back in time" to fix something that went wrong?
</div>
</section>
<section>
<h3>You already manage versions of your work!</h3>
<p> Do you have files somewhere that look like this?</p>
<pre><code>
Resume-September2013.docx
Resume-for-Duke-job.docx
ResumeOLD.docx
ResumeNEW.docx
ResumeREALLYREALLYNEW.docx
</code></pre>
<div class="fragment">
<p>You invented your own version control!</p>
<p>But, we can do it <span class="green">so much</span> better with Version Control tools</p>
</div>
</section>
<!-- History -->
<section>
<h3>Brief history of Version Control</h3>
<p><span class="green">1990s</span> — CVS (Concurrent Version Systems)</p>
<p><span class="green">2000s</span> — SVN (Apache Subversion)</p>
<p><span class="green">2005</span> — Git </p>
</section>
<section>
<h3>Chapter 1: Git is Born</h3>
<p>The first commit, April 2005</p>
<pre><code class="bash">
commit e83c5163316f89bfbde7d9ab23ca2e25604af29
Author: Linus Torvalds <torvalds@ppc970.osdl.org>
Date: Thu Apr 7 15:13:13 2005 -0700
Initial revision of "git", the information manager from hell
</code></pre>
</section>
<!-- Types -->
<section>
<h3>Version Control Types</h3>
<br>
<h4>Centralized Version Control</h4>
<p>Examples: CVS, SVN</p>
<br/>
<h4>Distributed Version Control</h4>
<p>Examples: Git, Mercurial</p>
</section>
<section>
<h3>Centralized Version Control</h3>
<img src="images/centralized-vc.png" alt="one central server with each person pushing changes to the main server" />
<p>One central server, each client (person) checks out and merges changes to main server</p>
<p class="fragment">...NOT how Git works!</p>
</section>
<section>
<h3>Distributed Version Control</h3>
<img src="images/distributed-vc.png" alt="each person works on her own local copy; each copy is reconciled with the main copy on the server" />
<p>Each client (person) has a local repository, which they can then reconcile with the main server.</p>
<p class="fragment">...this is how Git does it!</p>
</section>
<!-- Git-->
<section>
<h3>Why Use Git?</h3>
<ul>
<li><span class="green">Fast!</span> Access information quickly and efficiently.</li>
<li><span class="green">Distributed!</span> Everyone has her own local copy.</li>
<li><span class="green">Mind-bogglingly scalable!</span> Enables potentially thousands (millions!) of developers to work on single project.
<li><span class="green">Local!</span> You don't need a network connection to use it. You only need a remote server if you want to share your code with others (e.g., using GitHub).</li>
<li><span class="green">Branches!</span> Keep your coding experiments separate from code that is already working.</li>
<li>Everyone has a local copy of the <span class="green">shared files</span> and the <span class="green">history.</span></li>
</ul>
</section>
<!-- Installation and Setup-->
<section>
<section>
<h3>Installation and Setup</h3>
<a href="http://git-scm.com/downloads" alt="Download latest version of Git" target="_blank">
<p>Install git</p>
<img src="images/install-git.png" alt="Download latest version of Git" />
</a>
</section>
<section>
<h3>Installation and Setup</h3>
<p>Setup name and email in <code>git config</code></p>
<pre><code contenteditable class="bash">
$ git config --global user.name "Your Name Here"
# Sets the default name for git to use when you commit
</code></pre>
<pre><code contenteditable class="bash">
$ git config --global user.email "your_email@example.com"
# Sets the default email for git to use when you commit
</code></pre>
<pre><code contenteditable class="bash">
$ git config --list
</code></pre>
</section>
<section>
<h3>Installation and Setup</h3>
<p>Setup SSH keys</p>
<p><span class="green">SSH keys</span> allow you to interact with your Git server without having to type your username and password all the time.</p>
<p><a href="https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/">Generating SSH Keys</a></p>
<p><a href="https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/">Adding an SSH Key to your GitHub Account</a></p>
</section>
<section>
<h3>Installation and Setup</h3>
<p>Setup the Default Text Editor</p>
<p> By default Git is set up to use Vim as the text editor.</p>
<p>(<span class="green">esc</span> + <span class="green">:q</span> or <span class="green">:q!</span> to get out of Vim)</p>
<p>Follow <a href="https://help.github.com/articles/associating-text-editors-with-git/">these instructions</a> to change your default text editor to whatever you prefer. </p>
</section>
</section>
<!-- First commands-->
<section>
<h3>Your First Local Repository</h3>
<p>Go to home directory</p>
<pre><code contenteditable class ="bash">
$ cd ~/
$ pwd #make sure you're in your home directory
</code></pre>
<p>Create a "working directory"</p>
<pre><code contenteditable class ="bash">
$ mkdir my-repo
$ cd my-repo
</code></pre>
<p>Initialize repository with Git</p>
<pre><code contenteditable class ="bash">
$ git init
$ git status
</code></pre>
<p><small><a href="https://help.github.com/articles/about-readmes/" target="_blank">More about README.md</a></small></p>
<aside class="notes">Acceptable tangent: READMEs</aside>
</section>
<section>
<h3>Add Files</h3>
<p>Create a <code>README.md</code> file in your new folder</p>
<p>Check repo status</p>
<pre><code contenteditable class ="bash">
$ git status
</code></pre>
<p>Tell Git to track our new file</p>
<pre><code contenteditable class="bash">
$ git add README.md
$ git status
</code></pre>
<p>File is now tracked by Git</p>
</section>
<section>
<h3>Changes and Commits</h3>
<p>Open <code>README.md</code> and add some more text</p>
<pre><code contenteditable class="bash">
$ git status
</code></pre>
<p>Stage and commit the change</p>
<pre><code contenteditable class="bash">
$ git add README.md
$ git commit -m "First commit. Added README to repository."
</code></pre>
<p>A <a href="https://alistapart.com/article/the-art-of-the-commit" target="_blank">good commit message</a> acts like a headline to a newspaper article (but not clickbait!)</p>
</section>
<!-- Explanation-->
<section>
<h3>What did we just do?</h3>
<p>How is this all different than just saving a file?</p>
<ul>
<li class="fragment">When we <span class="green">add</span> a new file, we tell Git to add the file to the repository to be tracked. </li>
<li class="fragment">This is also called <span class="green">staging</span> a file. A snapshot of our changes is now in the <span class="green">staging area</span> (aka the <span class="green">index</span>, aka the <span class="green">cache</span>), ready to be saved.
</li>
<li class="fragment">A <span class="green">commit</span> saves the <span class="blue">changes</span> made to a file, not the file as a whole. The commit will have a unique ID (hash) so we can track which changes were committed when and by whom.</li>
</ul>
</section>
<section>
<h3>Look at Your Progress</h3>
<pre><code contenteditable class="bash">
$ git log
</code></pre>
<pre><code contenteditable class="bash">
commit [HASH HERE]
Author: Your name <you@your-email.com>
Date: [DATE HERE]
First commit. Added README to repository.
</code></pre>
</section>
<!-- Develop It -->
<section>
<h2>Let's Try It!</h2>
<ul>
<li>Make changes to <code>README.md</code> and make some more commits.</li>
<li>Add another file (or image!) to your project and commit that.</li>
<li>Change more than one file at a time, and practice making commits where you stage only one file, or both files together.</li>
</ul>
<h4 style="margin-top: 30px;"> Don't forget to run <code class="green">git status</code> regularly so that you can see what is happening at each stage!</h4>
</section>
<!-- Undoing changes -->
<section>
<h3>Nobody's Perfect</h3>
<h4>Undoing local changes</h4>
<p>If you haven't staged/committed yet</p>
<div class="fragment">
<p>Open <code>README.md</code> and make some changes to the file.</p>
<pre><code contenteditable class="bash">
$ git checkout README.md
</code></pre>
</div>
<p class="fragment">Look at <code>README.md</code>. Your changes are gone. You've gone back to the previous commit state.</p>
</section>
<section>
<h3>Nobody's Perfect</h3>
<h4>Remove a file from staging</h4>
<p>Create new file <code>my_new_file.txt</code></p>
<pre><code contenteditable class="bash">
$ git add my_new_file.txt
$ git reset my_new_file.txt
</code></pre>
<p>The file is removed from staging, but your working copy will be unchanged.</p>
</section>
<section>
<h3>Nobody's Perfect</h3>
<h4>Undoing staged changes</h4>
<div class="fragment">
<p>Open <code>README.md</code> and add some new text</p>
<pre><code contenteditable class="bash">
$ git add README.md
$ git reset HEAD README.md
$ git status ## your changes were unstaged
$ git checkout README.md
</code></pre>
</div>
<p class="fragment">Look at <code>README.md</code>. Your changes are gone and the file is removed from staging.</p>
</section>
<section>
<h3>Nobody's Perfect</h3>
<h4>Undoing committed changes</h4>
<p>Git lets you go back to any previous commit.</p>
<div class="fragment">
<p>Open <code>README.md</code> and add some new text</p>
<pre><code class="bash">
$ git add README.md
$ git status
$ git commit -m "Make a change I will soon regret making"
$ git log --oneline
</code></pre>
<p>Okay, I see the change… now how do I remove it?</p>
</div>
<aside class="notes">Now is a good time to talk about short commit hashes</aside>
</section>
<section>
<h3>Nobody's Perfect</h3>
<h4>Undoing committed changes</h4>
<pre><code class="bash">
$ git revert 53d23c4
# Your default editor will open here
# you can just save it and close it as is.
$ git log --oneline
</code></pre>
<p>Notice that the original, regrettable commit is still there, but now you also have <span class="green">another commit that undoes the changes</span> introduced by the original one.</p>
</section>
<!-- What to track -->
<section>
<h3>To Track or not to Track?</h3>
<p>You decide what goes into version control.</p>
<p class="fragment">You can—and should!—leave some things out.</p>
<p class="fragment green">libraries, .dotfiles, api keys...</p>
<p class="fragment">Git shows you an easy way to do this: <a href="https://help.github.com/articles/ignoring-files/">.gitignore</a></p>
</section>
<!-- Branches-->
<section>
<h3>Branching</h3>
<img src="images/branches.jpg" alt="blue birds on branches" />
<p>A branch is another copy of your repo that allows you to isolate changes and leave the original copy untouched. You can choose to combine these changes in whole or part with the "master" copy later. </p>
</section>
<section>
<h3>Branching</h3>
<p>Why Branch?</p>
<ul>
<li>Develop different code on the same base</li>
<li>Conduct exploratory work without affecting the work on master branch</li>
<li>Incorporate changes to your master branch only when you are ready</li>
<li>Make it easier to collaborate</li>
</ul>
</section>
<section>
<h3>Branching</h3>
<p>Create a new branch called <code>my-feature</code></p>
<pre><code contenteditable class="bash">
$ git checkout -b my-feature
</code></pre>
<p>Add new lines to <code>README.md</code></p>
<pre><code contenteditable class="bash">
$ git add README.md
$ git commit -m "Adding changes to my-feature"
</code></pre>
<aside class="notes">This is a good time to talk about naming best practices</aside>
</section>
<section>
<h3>Branching</h3>
<h4>Switching Branches</h4>
<p>See all branches. Branch with * is active</p>
<pre><code contenteditable class="bash">
$ git branch
</code></pre>
<p>Switch to <code>master</code> and look at <code>README.md</code></p>
<pre><code contenteditable class="bash">
$ git checkout master
</code></pre>
<p>Switch to <code>my-feature</code> and look at <code>README.md</code></p>
<pre><code contenteditable class="bash">
$ git checkout my-feature
</code></pre>
</section>
<!-- Merging-->
<section>
<h3>Merging</h3>
<p>Copying changes from one branch to another is called <span class="green">merging</span>.</p>
<p>Switch to <code>master</code> and merge the changes from the branch <code>my-feature</code></p>
<pre><code contenteditable class="bash">
$ git checkout master
$ git merge my-feature
$ git log --oneline
</code></pre>
</section>
<section>
<h3>Merging—When Things Go Wrong</h3>
<p>What is a merge confict?</p>
<img src="images/merge-conflict.png" />
</section>
<section>
<h3>Merging</h3>
<h4>Merge Conflicts</h4>
<p>Change first line in <code>README.md</code> in <code>master</code> branch</p>
<pre><code contenteditable class="bash">
$ git add README.md
$ git commit -m "Changing first line in master"
</code></pre>
<p>Change first line in <code>README.md</code> in <code>my-feature</code> branch</p>
<pre><code contenteditable class="bash">
$ git checkout my-feature
# open README.md and change first line
$ git add README.md
$ git commit -m "Changing first line in my-feature"
</code></pre>
</section>
<section>
<h3>Merging</h3>
<h4>Merge conflicts, cont.</h4>
<p>Merge from <code>master</code> into <code>my-feature</code></p>
<pre><code contenteditable class="bash">
$ git merge master
</code></pre>
<p class="fragment">You will be notified of a conflict. Go to the file and fix the problem. Then commit your edits.</p>
</section>
<!-- GitHub-->
<section>
<h3><a href="http://www.github.com" alt="GitHub homepage">Git + Friends = GitHub</a></h3>
<img src="images/github.jpg" alt="GitHub is social coding" style="max-height: 500px;" />
</section>
<section>
<h3>What is GitHub for?</h3>
<ul>
<li class="fragment">GitHub allows users to <span class="green">host Git repositories</span> publicly and privately</li>
<li class="fragment"><span class="green">Open source projects</span> host or mirror their repositories on GitHub</li>
<li class="fragment"><span class="green">Push your own code up</span> for others to use or contribute to</li>
<li class="fragment">Read, copy, and <span class="green">learn</span> from the code in other people's repositories</li>
<li class="fragment"><span class="green">Contribute to open source projects</span> (like the <a href="https://github.com/girldevelopit/gdi-website">Girl Develop It website</a>!)</li>
</ul>
</section>
<!-- New repository-->
<section>
<h3>GitHub</h3>
<h4>Create your first remote repository</h4>
<p>You will need to be logged into your GitHub account to do this.</p>
<img src="images/new-repo-menu-gdibtv.png" alt="" />
</section>
<section>
<h3>GitHub</h3>
<h4><a href="https://help.github.com/articles/create-a-repo/">Create your first repository</a></h4>
<img src="images/new-repo-screen-gdibtv.png" alt="" />
<aside class="notes">Recommend that they name this the same as their local repo</aside>
</section>
<section>
<h3>GitHub</h3>
<h4>Set up remote repo to sync with your local repo</h4>
<p> After you click the big green button to create your repo, follow GitHub's instructions for next steps. </p>
<pre><code class ="command-line">
$ git remote add origin https://github.com/YOUR-GITHUB-USERNAME/REPO.git
$ git push -u origin master
# that -u is an option that signals that you are setting
# a tracking reference to the remote branch as the default;
# you only need to use this flag the first time
</code></pre>
<p class="fragment">Now check out your GitHub repo online!</p>
</section>
<!-- Git Structure -->
<section>
<h3>Git Structure & Workflow</h3>
<p>Now, GitHub is acting as our remote repository</p>
<img src="images/basic-remote-workflow.png" style="height:550px;" />
</section>
<!-- Push and Pull -->
<section>
<h3>GitHub</h3>
<h4>Push to Repo on GitHub</h4>
<p>Edit <code>README.md</code>
<pre><code contenteditable class="bash">
$ git add README.md
$ git commit -m "Updating readme file"
$ git push origin master
</code></pre>
<p class="fragment">Now check out your GitHub repo online!</p>
</section>
<section>
<h3>Shared Repos</h3>
<p>If team members are contributing to a single repo, each member of the team will want to make sure that she has everyone else's changes before pushing her own changes to the remote repository.</p>
<div class="fragment">
<p class="green">Always pull before you push!</p>
</div>
</section>
<section>
<h3>Pulling</h3>
<p>Commit local changes first</p>
<pre><code class ="command-line">
$ git commit -m "My latest commit"
</code></pre>
<p>Get changes that have been pushed</p>
<pre><code class ="command-line">
$ git pull origin master
</code></pre>
<p>Git may prompt you to fix any conflicts, then commit</p>
<pre><code class ="command-line">
$ git commit -m "Fixing merging conflicts"
</code></pre>
<p>Now you are ready to push local changes to GitHub</p>
<pre><code class ="command-line">
$ git push origin master
</code></pre>
</section>
<!-- Fork a repository-->
<section>
<h3>Forking</h3>
<p>There are <span class="green">MILLIONS</span> of public repositories on GitHub.</p>
<p>There are huge open source projects (<a href="https://github.com/git/git" target="_blank">including Git!</a>)…</p>
<p>…and small projects like these slides.</p><br>
<h4>Collaborating</h4>
<p>If you want to use or contribute to a repository, you have to <span class="green">fork</span> the repository, then <span class="green">clone</span> it to your computer.</p>
<p>A fork is just a copy of a repository, saved to GitHub.</p>
</section>
<section>
<h3>Forking</h3>
<img src="images/fork-gdi.png" alt="How to fork a repository." />
<p>After you fork the repository, it shows up in your repositories.</p>
<img src="images/fork-gdi-btv.png" alt="A forked repository." />
<p>Let's Try It! <a href="https://github.com/GDIBTV/git-resources">Fork this repo.</a></p>
<p><small>You can only fork repos through the GitHub website.</small></p>
</section>
<section>
<h3>Cloning</h3>
<p>To get a local copy of the fork you just made, use the <code class="green">git clone</code> command.</p>
<pre><code class ="command-line">
$ cd ../
$ git clone https://github.com/USERNAME/git-resources.git
$ cd git-resources
$ git remote -v
</code></pre>
</section>
<section>
<h3>Girl Developer <br>and the Three Repositories</h3>
<div class="fragment">
There are now THREE copies of this repo that you have access to.
</div>
<img src="images/three_kittens.jpg" class="fragment" style="max-height:200px;">
<br>
<div class="fragment">
the original (on Github)* => <span class="green">upstream</span>
</div>
<div class="fragment">
your fork (on GitHub) => <span class="green">origin</span>
</div>
<div class="fragment">
your clone => <span class="green">your local repo</span>, just like you're used to
</div>
<aside class="notes">* well, you can pull changes from this repo, you may not be able to modify it</aside>
</section>
<section>
<h3>Connect to the Original</h3>
<p>To sync your fork with the original repo, you need to add another remote named <code>upstream</code></p>
<pre style="width: 100%;"><code>
$ git remote -v
$ git remote add upstream https://github.com/GDIBTV/git-resources.git
$ git fetch upstream
</code></pre>
<p><code class="green">git fetch</code> downloads Git references not present in your local repository, but does not modify your files (think of it like getting a table of contents rather than the contents themselves)</p>
</section>
<!-- Pull requests-->
<section>
<h3>Pull Requests</h3>
<p class="fragment">After you <code>fork</code> and <code>clone</code> a repository all pushed changes will go to your fork (<code>origin</code>)</p>
<p class="fragment">These changes do not affect the original (<code>upstream</code>) repository (mostly because permissions). To do that, you need to submit a pull request.</p>
<p class="fragment">A <span class="green">pull request</span> is a GitHub feature that lets you ask the owner of the upstream repo to pull your changes in.</p>
</section>
<section>
<h3>Starting a Pull Request</h3>
<img src="images/click-pull-request.png" alt="How to initiate a pull request. Image from https://help.github.com/articles/using-pull-requests" />
<p>Pull requests can only be done through the GitHub website.</p>
</section>
<section>
<h3>Opening Pull Requests</h3>
<img src="images/pull-request-review-page.png" alt="How to preview and send a pull request. Image from https://help.github.com/articles/using-pull-requests" />
<aside class="notes">Acceptable tangent: style guides and contribution outlines</aside>
</section>
<section>
<h3>Managing Pull Requests</h3>
<p>Repo owners review and decide whether to merge in the pull requests they receive.</p>
<p>You can learn more from the <br><a href="https://help.github.com/categories/63/articles" target="_blank" alt="Links to tutorials on pull requests and collaboration">Github Collaborating Tutorials</a>
</section>
<!-- Develop It -->
<section>
<h2>Let's Try It!</h2>
<ul>
<li>Make changes to the <code>git-resources</code> repository and push to your remote.</li>
<li>Submit a pull request to the original repository.</li>
<li>Explore other repos on GitHub and get excited about the world that is now open to you!</li>
</ul>
</section>
<!-- The End -->
<section>
<h2>Thank You!</h2>
<p>Keep in touch!</p>
<p><a href="mailto:rachaela@girldevelopit.com">rachaela@girldevelopit.com</a></p>
<p><a href="http://www.raearnold.com/">raearnold.com</a></p>
</section>
</div>
<footer>
<div class="copyright">
Intro to Git and Github -- Girl Develop It Burlington --
<a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/3.0/80x15.png" /></a>
</div>
</footer>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
dependencies: [{
src: 'lib/js/classList.js',
condition: function() {
return !document.body.classList;
}
}, {
src: 'plugin/markdown/marked.js',
condition: function() {
return !!document.querySelector('[data-markdown]');
}
}, {
src: 'plugin/markdown/markdown.js',
condition: function() {
return !!document.querySelector('[data-markdown]');
}
}, {
src: 'plugin/highlight/highlight.js',
async: true,
condition: function() {
return !!document.querySelector('pre code');
},
callback: function() {
hljs.initHighlightingOnLoad();
}
}, {
src: 'plugin/zoom-js/zoom.js',
async: true
}, {
src: 'plugin/notes/notes.js',
async: true
}, {
src: 'plugin/accessibility-helper/js/accessibility-helper.js',
async: true,
condition: function() {
return !!document.body.classList;
}
}]
});
</script>
</body>
</html>