-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
607 lines (577 loc) · 21.3 KB
/
index.html
File metadata and controls
607 lines (577 loc) · 21.3 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Git[hub] - for dummies</title>
<meta name="description" content="A quick introduction to github and gitflows in Italian">
<meta name="author" content="Antonio Pastorino">
<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, minimal-ui">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/night.css" id="theme">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match(/print-pdf/gi) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName('head')[0].appendChild(link);
</script>
<!--[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">
<section>
<h1>Git[hub]</h1>
<h3>For dummies</h3>
<p>
<small>Created by <a href="http://github.com/andou">Antonio Pastorino</a> / <a href="mailto:a.pastorino@bitmama.it">a.pastorino@bitmama.it</a></small>
</p>
</section>
<section>
<section>
<h2>Outline</h2>
</section>
<section>
<ul>
<li>What are git and github</li>
<li>How they work</li>
<li>How can I use them</li>
</ul>
</section>
</section>
<section>
<section>
<h2>Definitions</h2>
</section>
<section>
<blockquote cite="http://en.wikipedia.org/wiki/Git_(software)">
“Git (/ɡɪt/) is a <strong>distributed revision control system</strong> with an emphasis on speed, data integrity, and support for distributed, non-linear workflows.”
</blockquote>
</section>
<section>
<div>
<img width="500" data-src="http://static.guim.co.uk/sys-images/Guardian/About/General/2010/10/20/1287571854392/Homer-Simpson-006.jpg" alt="so what?">
</div>
<p>
so what??
</p>
</section>
<section>
<blockquote cite="http://en.wikipedia.org/wiki/Revision_control">
“<strong>Revision control</strong>, also known as version control and source control, is the management of changes to documents, computer programs, large web sites, and other collections of information.”
</blockquote>
<p class="fragment">
clear, uh?
</p>
</section>
</section>
<section>
<section>
<h2>Survey</h2>
</section>
<section>
<p>Who already knows Git?</p>
</section>
<section>
<p>Who knows any of these?</p>
<ul>
<li>SVN</li>
<li>CVS</li>
<li>Mercurial</li>
</ul>
</section>
</section>
<section>
<section>
<h2>Why should I use version control?</h2>
</section>
<section>
<blockquote cite="https://www.youtube.com/watch?v=0aRtupiY9Dw">
“An elegant weapon for a more civilized age.”
</blockquote>
</section>
<section>
<h3>Look, it's not useful if I</h3>
<ul>
<li>Do not have other people working on the code.</li>
<li>Do not plan on letting others have the code.</li>
<li class="fragment">Isn't it an overhead?</li>
</ul>
</section>
<section>
<h3>Well, have you ever</h3>
<ul>
<li>made a change to code, realised it was a mistake and wanted to revert back?</li>
<li>lost code or had a backup that was too old?</li>
<li>had to maintain multiple versions of a product?</li>
</ul>
</section>
<section>
<h3>And if you wonder to</h3>
<ul>
<li>see the difference between two (or more) versions of your code?</li>
<li>prove that a particular change broke or fixed a piece of code?</li>
<li>review the history of some code?</li>
</ul>
</section>
<section>
<h3>Or even</h3>
<ul>
<li>submit a change to someone else's code?</li>
<li>share your code, or let other people work on your code?</li>
<li>see how much work is being done, and where, when and by whom?</li>
</ul>
</section>
<section>
<h3>And, last but not least</h3>
<ul>
<li>wanted to experiment with a new feature without interfering with working code?</li>
</ul>
</section>
</section>
<section>
<section>
<h2>Version control systems</h2>
</section>
<section>
<h3>Local</h3>
<div>
<img width="500" data-src="http://git-scm.com/book/en/v2/book/01-introduction/images/local.png" alt="Local VCS">
</div>
</section>
<section>
<h3>Centralized</h3>
<div>
<img width="500" data-src="http://www.devopsservice.com/wp-content/uploads/2015/05/Centralized-VCS1.png" alt="Centralized VCS">
</div>
</section>
<section>
<h3>Distributed</h3>
<div>
<img width="500" data-src="http://git-scm.com/book/en/v2/book/01-introduction/images/distributed.png" alt="Distributed VCS">
</div>
</section>
</section>
<section>
<section>
<h2>About Git</h2>
</section>
<section>
<h3>Desing Goals</h3>
<ul>
<li>Speed</li>
<li>Simple Design</li>
<li>Strong support for thousands of parallel branches<l/i>
<li>Fully distributed </li>
<li>Able to handle larges projects like Linux kernel effectively </li>
<li>Ensure integrity </li>
</ul>
</section>
<section>
<h3>Git is a filesystem</h3>
<blockquote>Git thinks of its data more like a set of snapshots of a mini filesystem.</blockquote>
</section>
<section>
<h3>Git has integrity</h3>
<ul>
<li>Everything is checksummed</li>
<li>References are SHA-1</li>
</ul>
<br/>
<p class="fragment">
986da33f0edea8f13b8dee427262ffd1bce0a4c4
</p>
</section>
<section>
<h3>Git doesn't delete</h3>
<ul>
<li>generally only adds data </li>
<li>if you mess up, you can usually recover your stuff </li>
<li>not for everyone, though</li>
</ul>
</section>
</section>
<section>
<section>
<h2>Git states & workflow</h2>
</section>
<section>
<h3>Three states</h3>
<ul>
<li>Modified</li>
<li>Staged</li>
<li>Committed</li>
<li class="fragment roll-in">Pushed?</li>
</ul>
</section>
<section>
<h3>Workflow</h3>
<div>
<img width="500" data-src="http://git-scm.com/figures/18333fig0106-tn.png" alt="workflow">
</div>
</section>
<section>
<h3>File status lifecycle</h3>
<div>
<img width="500" data-src="http://git-scm.com/figures/18333fig0201-tn.png" alt="lifecycle">
</div>
</section>
</section>
<section>
<section>
<h2>About Github</h2>
</section>
<section>
<div>
<img width="200" data-src="http://i1-news.softpedia-static.com/images/news2/Twitter-s-Original-Logo-Designer-Only-Made-3-from-It-2.jpg" alt="Octocat">
</div>
<ul>
<li>web-based Git repository hosting service</li>
<li>offers all of the distributed SCM functionalities of Git</li>
<li>adds new features</li>
</ul>
</section>
<section>
<h3>New features</h3>
<ul>
<li>web-based graphical interface</li>
<li>desktop & mobile integration</li>
<li>access control</li>
<li>pull requests</li>
<li class="fragment">and more (wikis, task management, bug tracking, etc.)</li>
</ul>
</section>
</section>
<section>
<section>
<h2>Installing Git</h2>
</section>
<section>
<h3>Windows</h3>
<p>msysgit: <a href="https://msysgit.github.io/">https://msysgit.github.io/</a></p>
</section>
<section>
<h3>Linux</h3>
<p style="text-align: left;">Debian <pre>$ aptitude install git</pre></p>
<p style="text-align: left;">Ubuntu <pre>$ apt-get install git</pre></p>
<p style="text-align: left;">Centos <pre>$ yum install git</pre></p>
<p style="text-align: left;">Arch <pre>$ pacman -S git</pre></p>
</section>
<section>
<h3>OS X</h3>
<p><pre>$ brew install git</pre></p>
<p class="fragment" style="text-align: left;">Also developer tools should be ok...</p>
</section>
</section>
<!-- Configuring Git -->
<section>
<section>
<h2>Configuring Git</h2>
</section>
<section>
<h3>Identity</h3>
<pre>$ git config --global user.name "Peter Parker"<br>$ git config --global user.email peterparker@bitmama.it</pre>
</section>
<section>
<h3>Editor</h3>
<pre>$ git config --global core.editor nano</pre>
</section>
<section>
<h3>Colors</h3>
<pre>$ git config --global color.ui true</pre>
</section>
<section>
<p>Configurations are in ~/.gitconfig</p>
</section>
</section>
<!-- Using Github -->
<section>
<section>
<h2>Using Github</h2>
</section>
<section>
<h3>Join github</h3>
<p><a href="https://github.com/join">https://github.com/join</a></p>
</section>
<section>
<h3>Private/Public Key</h3>
<p style="text-align: left;">SSH keys are a way to identify trusted computers, without involving passwords.</p>
<p><a href="https://help.github.com/articles/generating-ssh-keys/">https://help.github.com/articles/generating-ssh-keys/</a></p>
</section>
</section>
<!-- Starting with Git -->
<section>
<section>
<h2>Starting with Git</h2>
</section>
<section>
<h3>Initizialize your project</h3>
<pre>$ git init</pre>
</section>
<section>
<h3>Or clone it</h3>
<pre>$ git clone https://github.com/andou/github-for-dummies.git</pre>
</section>
<section>
<h3>What's up?</h3>
<pre>$ git status</pre>
</section>
<section>
<h3>Decide what is relevant</h3>
<pre>$ git add file1 file2 ...<br/>$ git commit</pre>
</section>
<section>
<h3>What did I just modify</h3>
<pre>$ git diff</pre>
</section>
<section>
<h3>What happened?</h3>
<pre>$ git log</pre>
</section>
<section>
<h3>I've screwed everything up....</h3>
<pre>$ git reset</pre>
</section>
</section>
<!-- .gitignore -->
<section>
<section>
<h2>.gitignore</h2>
</section>
<section>
<h3>sample</h3>
<pre>.DS_Store<br/>*.log<br/>/build/<br/>/doc/[abc]*.txt<br/>.sass-cache
</pre>
</section>
<section>
<ul>
<li>Blank lines or lines starting with # are ignored</li>
<li>End pattern with slash (/) to specify a directory</li>
<li>Negate pattern with exclamation point (!) </li>
</ul>
</section>
</section>
<!-- Remotes -->
<section>
<section>
<h2>Remotes</h2>
</section>
<section>
<ul>
<li>Other clones of the same repo</li>
<li>Can be more than one</li>
<li>There are default remotes for push and pull</li>
<li class="fragment roll-in">Github is a remote</li>
</ul>
</section>
<section>
<pre>$ git remote -v<br>origin https://github.com/andou/github-for-dummies.git (fetch)<br>origin https://github.com/andou/github-for-dummies.git (push)</pre>
</section>
<section>
<h3>Push to remote</h3>
<pre>$ git push <remote> <branch></pre>
</section>
<section>
<h3>Pull from remote</h3>
<pre>$ git pull <remote> <branch></pre>
</section>
</section>
<!-- Tags -->
<section>
<section>
<h2>Tags</h2>
</section>
<section>
<ul>
<li>specify important points in history</li>
<li>tipically release points</li>
</ul>
</section>
<section>
<h3>Lightweight tags</h3>
<pre>$ git tag v0.0.1</pre>
</section>
<section>
<h3>Annotated tags</h3>
<pre>$ git tag -a v0.0.1 -m 'this is my tag'</pre>
</section>
</section>
<!-- Branches -->
<section>
<section>
<h2>Branches</h2>
</section>
<section>
<ul>
<li>are "pointers" to commit</li>
<li>identify streams of development</li>
<li>they can diverge from each other</li>
<li>they can be merged</li>
</ul>
</section>
<section>
<h3>Diverging branches</h3>
<img width="500" data-src="http://git-scm.com/book/en/v2/book/03-git-branching/images/basic-branching-6.png" alt="Diverging Branches">
</section>
<section>
<h3>Merged branches</h3>
<img width="500" data-src="http://git-scm.com/book/en/v2/book/03-git-branching/images/basic-merging-2.png" alt="Merged Branches">
</section>
<section>
<h3>Merging</h3>
<ul>
<li>There are different auto-merge strategies</li>
<li>If it fails, you'll have to fix by hand</li>
<li>Mark conflicts as resolved and trigger a merge commit</li>
</ul>
</section>
</section>
<section>
<section>
<h2>Branch management</h2>
</section>
<section>
<h3>Create new branch</h3>
<pre>$ git branch iss53</pre>
<pre>$ git checkout -b iss53 master</pre>
</section>
<section>
<h3>Switch Branch</h3>
<pre>$ git checkout iss53</pre>
</section>
<section>
<h3>Delete Branch</h3>
<pre>$ git branch -d iss53</pre>
</section>
</section>
<section>
<section>
<h2>Stashing</h2>
</section>
<section>
<p>Move changes to a separate "stash".</p>
<pre>$ git stash save<br>$ git stash list<br>$ git stash apply</pre>
</section>
</section>
<section>
<section>
<h2>Workflow</h2>
</section>
<section>
<h3>Progressive stability</h3>
<img width="500" data-src="http://git-scm.com/book/en/v2/book/03-git-branching/images/lr-branches-2.png" alt="Progressive Stability">
</section>
<section>
<h3>Topic branches</h3>
<img width="500" data-src="http://git-scm.com/book/en/v2/book/03-git-branching/images/topic-branches-1.png" alt="Topic branches">
</section>
</section>
<section>
<section>
<h2>References</h2>
<ul>
<li>Git: <a href="http://git-scm.com/">http://git-scm.com/</a></li>
<li>Github: <a href="https://github.com/">https://github.com/</a></li>
<li>Try git: <a href="http://try.github.com/">http://try.github.com/</a></li>
</ul>
</section>
<section>
<h2>More references</h2>
<ul>
<li><a href="http://www.git-tower.com/blog/git-cheat-sheet/">CheatSheet</a></li>
<li><a href="https://gist.github.com/andou/0aaae87ef476e4d7a77d">My shortcodes</a></li>
</ul>
</section>
<section>
<h2>Some more...</h2>
<ul>
<li>Book [for pro]: <a href="http://git-scm.com/book/en/v2">http://git-scm.com/book/en/v2</a></li>
<li>Git Docs: <a href="http://git-scm.com/docs">http://git-scm.com/docs</a></li>
<li><a href="https://www.kernel.org/pub/software/scm/git/docs/gittutorial.html">Deep tutorial</a></li>
</ul>
</section>
<section>
<h2>Not enough??</h2>
<ul>
<li><a href="https://www.youtube.com/watch?v=4XpnKHJAok8">Y U no ask Linus Torvalds?</a></li>
</ul>
<div>
<img width="250" data-src="https://pbs.twimg.com/profile_images/1240974873/Untitled_1.png" alt="Y U NO!?">
</div>
</section>
</section>
<section style="text-align: left;">
<h1>THE END</h1>
<p>
- <a href="http://goo.gl/sE1Jer">Link to this presentation</a> <br>
- <a href="https://github.com/andou/github-for-dummies">Source code of this presentation</a>
</p>
</section>
<section>
<h2>Legal</h2>
<div>
<br>
</div>
<h5>License</h5>
<div>
<img src="http://mirrors.creativecommons.org/presskit/icons/cc.png" alt="CC BY-SA 3.0" title="CC BY-SA 3.0" class="noborder">
<img src="http://mirrors.creativecommons.org/presskit/icons/by.png" class="noborder">
<img src="http://mirrors.creativecommons.org/presskit/icons/sa.png" class="noborder">
<p style="font-size: 0.7em;">CC BY-SA 3.0</p>
</div>
<div>
<br>
</div>
<h5>Attribution</h5>
<ul>
<li>Most illustrations: <a href="http://git-scm.com/book" class="roll"><span data-title="http://git-scm.com/book">http://git-scm.com/book</span></a></li>
<li>Some slides are shamelessly taken from: <a href="https://dbrgn.ch/slides/20130207_getting_git" class="roll"><span data-title="http://git-scm.com/book">https://dbrgn.ch/slides/20130207_getting_git</span></a> whose author is <a href="https://dbrgn.ch/">Danilo Bargen</a></li>
</ul>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
slideNumber: true,
progress: true,
history: true,
center: true,
parallaxBackgroundImage: 'bgparallax/instanbulBgParallax.png',
parallaxBackgroundSize: '1920px 1080px',
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}
]
});
</script>
</body>
</html>