forked from luisibanez/Git-Introduction-Part-II
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
636 lines (543 loc) · 18.9 KB
/
index.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Git Introduction II - Remote Repositories</title>
<meta name="description" content="Introduction to Git Remote Repositories">
<meta name="author" content="Luis Ibanez">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="revealjs/css/reveal.min.css">
<link rel="stylesheet" href="revealjs/css/theme/sky.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="revealjs/lib/css/zenburn.css">
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="revealjs/css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h1>Git</h1>
<h2>Introduction</h2>
<h3>Part II</h3>
<p>
<small>Created by <a href="https://opensource.com/users/luis-ibanez">Luis Ibanez</a> / <a href="http://twitter.com/luisibanez">@luisibanez</a></small>
</p>
</section>
<section>
<a rel="license" href="http://creativecommons.org/licenses/by/3.0/deed.en_US">
<img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/88x31.png" />
</a>
<br />
<span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/InteractiveResource" property="dct:title" rel="dct:type">Git Introduction</span>
by
<span xmlns:cc="http://creativecommons.org/ns#" property="cc:attributionName">Luis Ibanez</span>
is licensed under a
<a rel="license" href="http://creativecommons.org/licenses/by/3.0/deed.en_US">Creative Commons Attribution 3.0 Unported License</a>.
</section>
<section>
<h3>Complete First</h3>
<h2><a href="http://www.opensourcesoftwarepractice.org/Git-Introduction-Part-I">Introduction Part I</a></h2>
</section>
<section>
<h3>Clone Repository</h3>
<pre><code data-trim contenteditable>
git clone [email protected]:ossp/Git-Branchy-Story-Exercise-02.git
</code></pre>
<ul>
<li>github username = "ossp"
<li>repository name = "Branchy-Story-Exercise-02"
</ul>
</section>
<section>
<h3>Go Inside the Directory</h3>
<pre><code data-trim contenteditable>
cd Branchy-Story-Exercise-02
</code></pre>
</section>
<section>
<h3>See the remote repositories </h3>
<pre><code data-trim contenteditable>
git remote -v
</code></pre>
<ul>
<li>"-v" is for "verbose"
</ul>
</section>
<section>
<h4>At this point we have a</h4>
<h3><a href="http://git-scm.com/book/en/Distributed-Git-Distributed-Workflows#Centralized-Workflow">Shared Repository</a></h2>
<a href="#" class="image">
<img width="900" src="http://git-scm.com/figures/18333fig0501-tn.png" alt="Shared Repository">
</a>
<p>Courtesy of <a href="http://git-scm.com/book/en/Distributed-Git-Distributed-Workflows">git-scm Book</a>.</p>
</section>
<section>
<h3>This configuration</h3>
<h3>is used for a</h3>
<h2><a href="http://git-scm.com/book/en/Distributed-Git-Distributed-Workflows#Centralized-Workflow">Centralized Workflow</a></h2>
</section>
<section>
<h3>Git enables</h3>
<h3>other configurations...</h3>
</section>
<section>
<h3>to support</h3>
<h3>other workflows...</h3>
</section>
<section>
<h4>For example</h4>
<h3><a href="http://git-scm.com/book/en/Distributed-Git-Distributed-Workflows#Integration-Manager-Workflow">Integration Manager Workflow</a></h3>
<a href="#" class="image">
<img width="900" src="http://git-scm.com/figures/18333fig0502-tn.png" alt="Integration manager workflow">
</a>
<p>Courtesy of <a href="http://git-scm.com/book/en/Distributed-Git-Distributed-Workflows">git-scm Book</a>.</p>
</section>
<section>
<h2><a href="http://git-scm.com/book/en/Distributed-Git-Distributed-Workflows#Integration-Manager-Workflow">Let's do this ! </a></h2>
</section>
<section>
<h3>You already have</h3>
<h3>local private</h3>
<h3>repositories</h3>
</section>
<section>
<h3>Let's create</h3>
<h3>your public</h3>
<h3>repositories</h3>
</section>
<section>
<h3>We do this</h3>
<h3>by <a href="https://help.github.com/articles/fork-a-repo">forking</a></h3>
<h3>in Github</h3>
</section>
<section>
<h2>Fork the Repository</h2>
<a href="#" class="image">
<img src="images/GitIntroductionPartII-001.png" alt="Fork the repository">
</a>
</p>
</section>
<section>
<h2>Copy the Fork Address</h2>
<a href="#" class="image">
<img src="images/GitIntroductionPartII-002.png" alt="Fork address">
</a>
</p>
</section>
<section>
<h3>Now go to your</h3>
<h3>local private</h3>
<h3>repository</h3>
</section>
<section>
<h3>Add the Remote repository</h3>
<pre><code data-trim contenteditable>
git remote add luisgithub [email protected]:luisibanez/Git-Branchy-Story-Exercise-02.git
</code></pre>
<ul>
<li>luisgithub = local name for remote repository
</ul>
</section>
<section>
<h3>See the remote repositories </h3>
<pre><code data-trim contenteditable>
git remote -v
</code></pre>
<a href="#" class="image">
<img src="images/GitIntroductionPartII-003.png" alt="Add remote">
</a>
</section>
<section>
<h1>Your Turn !</h1>
</section>
<section>
<h2>Add Remote</h2>
<h2>Repositories</h2>
<p>Work with your Team</p>
<ul>
<li>Ask team members for their fork address
<li>Add their address as a remote
<li>Name the remotes after their first names
</ul>
</section>
<section>
<h2>Use HTTPS</h2>
<p>For the address of your team mates</p>
<ul>
<li>Use:
<li>https://github.com/aaronsw/...
<li>instead of
<li>[email protected]:aaronsw/...
</ul>
</section>
<section>
<h3>Now let's create</h3>
<h3>a team directory</h3>
<h3>to work together</h3>
</section>
<section>
<h3>One Team Member</h3>
<h3>Creates Team Directory</h3>
<pre><code data-trim contenteditable>
mkdir FantasticFour
cd FantasticFour
nano README.md
cd ..
</code></pre>
</section>
<section>
<h3>One Team Member</h3>
<h3>Commits Team Directory</h3>
<pre><code data-trim contenteditable>
git add FantasticFour
git commit -m "Started team directory"
</code></pre>
<h4>and push it upstream</h4>
<pre><code data-trim contenteditable>
git push origin master
</code></pre>
</section>
<section>
<h3>Your push may fail... </h3>
<h4>with a message like this</h4>
<pre><code data-trim contenteditable>
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:ossp/Git-Branchy-Story-Exercise-01.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and merge the remote changes
hint: (e.g. 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
</code></pre>
</section>
<section>
<h3>Your push may fail... </h3>
<h4>with a message like this</h4>
<a href="#" class="image">
<img src="images/GitIntroductionPartII-007.png" alt="Check logs">
</a>
</section>
<section>
<h3>This just means</h3>
<h3>than someone else</h3>
<h3>pushed before you</h3>
</section>
<section>
<h3>so now</h3>
<h3>you have to update</h3>
<h3>your local repository</h3>
</section>
<section>
<h4>Update With the Command</h4>
<pre><code data-trim contenteditable>
git pull origin master
</code></pre>
<h4>and then try again the Command</h4>
<pre><code data-trim contenteditable>
git push origin master
</code></pre>
</section>
<section>
<h3>You may have</h3>
<h3>to do it</h3>
<h3>multiple times</h3>
</section>
<section>
<h1>Breath!</h1>
<h1>Smile!</h1>
</section>
<section>
<h3>All Team Members</h3>
<h3>Update their local repositories</h3>
<pre><code data-trim contenteditable>
git pull origin master
</code></pre>
</section>
<section>
<h3>All Team Members</h3>
<h3>Look at recent commits</h3>
<pre><code data-trim contenteditable>
git log
</code></pre>
<a href="#" class="image">
<img src="images/GitIntroductionPartII-004.png" alt="Check logs">
</a>
</section>
<section>
<h2>Note That</h2>
<p>The log tells you:</p>
<ul>
<li>Who did it
<li>When it was done
</ul>
</section>
<section>
<h3>All Team Members</h3>
<h3>Look at recent commits</h3>
<h4>Using short format</h4>
<pre><code data-trim contenteditable>
git log --oneline
</code></pre>
<a href="#" class="image">
<img src="images/GitIntroductionPartII-005.png" alt="Check logs one lined">
</a>
</section>
<section>
<h2>Note That</h2>
<p>Every commit</p>
<p>is identified by a hash</p>
<p>such as:</p>
<pre><code data-trim contenteditable>
5d7d137a3592fe402a4bc282375c2d8bb878326c
</code></pre>
</section>
<section>
<h3>You can use</h3>
<h3>the first characters</h3>
<h3>to refer</h3>
<h3>to this commit</h3>
</section>
<section>
<h2>You can use</h2>
<h3>"git show"</h3>
<pre><code data-trim contenteditable>
git show 5d7d137
</code></pre>
<h4>to find out more</h4>
<h4>about this commit</h4>
</section>
<section>
<h3>See commit details</h3>
<pre><code data-trim contenteditable>
git show 5d7d137
</code></pre>
<a href="#" class="image">
<img src="images/GitIntroductionPartII-006.png" alt="Add remote">
</a>
</section>
<section>
<h2>Time to</h2>
<h2>Go Wild!</h2>
</section>
<section>
<h2>Each Team Member</h2>
<ul>
<li>Picks a "character" name
<li>Go into the team directory
<li>Creates a file with that name
<li>and extension ".md"
</ul>
</section>
<section>
<h2>Each Team Member</h2>
<ul>
<li>Inside the file write one sentence
<li>Describing the state of the character
</ul>
</section>
<section>
<h2>Each Team Member</h2>
<ul>
<li>Git add the file
<li>Git commit
<li>Git push upstream
</ul>
</section>
<section>
<h3>Your push may fail... </h3>
<h4>with a message like this</h4>
<pre><code data-trim contenteditable>
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:ossp/Git-Branchy-Story-Exercise-01.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and merge the remote changes
hint: (e.g. 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
</code></pre>
</section>
<section>
<h3>This just means</h3>
<h3>than someone else</h3>
<h3>pushed before you</h3>
</section>
<section>
<h3>so now</h3>
<h3>you have to update</h3>
<h3>your local repository</h3>
</section>
<section>
<h4>Update With the Command</h4>
<pre><code data-trim contenteditable>
git pull origin master
</code></pre>
<h4>and then try again the Command</h4>
<pre><code data-trim contenteditable>
git push origin master
</code></pre>
</section>
<section>
<h3>You may have</h3>
<h3>to do it</h3>
<h3>multiple times</h3>
</section>
<section>
<h2>Each Team Member</h2>
<ul>
<li>Edit the file of her/his character
<li>Change the state of the character
</ul>
</section>
<section>
<h2>Each Team Member</h2>
<ul>
<li>Git create branch
<li>Git select branch
<li>Git add
<li>Git commit into branch
</ul>
</section>
<section>
<h4>Use the Commands</h4>
<pre><code data-trim contenteditable>
git branch MyNewBranch
git checkout MyNewBranch
vim myCharacter.md
git add myCharacter.md
git commit
</code></pre>
</section>
<section>
<h3>The commit message</h3>
<h4>Must explain "how" and "why"</h4>
<h4>the character changed state</h4>
</section>
<section>
<h2>Each Team Member</h2>
<ul>
<li>Git move to master branch
<li>Git update master from upstream
<li>Git merge branch into master
<li>Git push master upstream
</ul>
</section>
<section>
<h4>Use the Commands</h4>
<pre><code data-trim contenteditable>
git checkout master
git pull origin master
git merge --no-ff MyNewBranch
git push origin master
</code></pre>
</section>
<section>
<h2>Reading the Story</h2>
<h4>as the story grows</h4>
<h4>you can read it</h4>
<h4>by using the command:</h4>
<pre><code data-trim contenteditable>
git log --no-merges .
</code></pre>
</section>
<section>
<h4>This will show you</h4>
<h4>what happened</h4>
<h4>to all the characters</h4>
<h4>in that directory</h4>
</section>
<section>
<h3>To read the Story</h3>
<h4>of a single character</h4>
<h4>use the command:</h4>
<pre><code data-trim contenteditable>
git log --no-merges myCharacter.md
</code></pre>
</section>
<section>
<h3>To read the summary</h3>
<h4>of the story</h4>
<h4>use the command:</h4>
<pre><code data-trim contenteditable>
git log --no-merges myCharacter.md --oneline
</code></pre>
</section>
<section>
<h3>You can see the Graph</h3>
<h4>with the command</h5>
<pre><code data-trim contenteditable>
git log --graph
</code></pre>
<a href="#" class="image">
<img src="images/GitIntroductionPartII-008.png" alt="Add remote">
</a>
</section>
<section>
<h3>You can see the Graph</h3>
<h4>with the tool gitk</h4>
<pre><code data-trim contenteditable>
gitk
</code></pre>
<a href="#" class="image">
<img src="images/GitIntroductionPartII-009.png" alt="Add remote">
</a>
</section>
<section>
<h1>Your Turn !</h1>
</section>
<section>
<h2>Unleash your imagination!</h2>
</section>
<section>
<h3>Coordinate</h3>
<h3>with your team mates</h3>
<ul>
<li>Interactions between your characters
<li>Apply the state changes to your files
<li>Git commit, add, merge, every time
<li>Read the story as it progresses
</ul>
</section>
<section>
<h2>Complete Five</h2>
<h2>Interactions</h2>
<h2>per character</h2>
</section>
<section>
<h1>Breath!</h1>
<h1>Smile!</h1>
</section>
<section>
<h1>THE END</h1>
<h3>BY Luis Ibanez</h3>
</section>
</div>
</div>
<script src="revealjs/lib/js/head.min.js"></script>
<script src="revealjs/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,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'revealjs/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'revealjs/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'revealjs/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'revealjs/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'revealjs/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'revealjs/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
</body>
</html>