-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
565 lines (496 loc) · 26 KB
/
Copy pathindex.html
File metadata and controls
565 lines (496 loc) · 26 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Hello Git - PyLadies São Carlos</title>
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/beige.css">
<!-- Theme used for syntax highlighting of code -->
<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>
</head>
<body>
<div class="reveal">
<div class="slides">
<section data-markdown>
<script type="text/template">
## Hello Git!
<p class="fragment fade-up">
Criado por: <br/>
<a href="https://github.com/lucasaciole"
target="_blank">
<img src="https://user-images.githubusercontent.com/2916159/46261035-67dd7180-c4c4-11e8-89cc-5596f00f5857.jpg"
height="80" alt="Lucas Yuji. S Aciole"/>
<span style="position:relative; bottom:20px">
@lucasaciole
</span>
</a>
</p>
</script>
</section>
<section>
<section data-markdown>
<script type="text/template">
## O que é Git?
- Sistema de Controle de Versão (VCS)<!-- ..element: class="fragment fade-right" fragment-index="1" -->
- Distribuido <!-- ..element: class="fragment fade-right" fragment-index="2" -->
</script>
</section>
<section data-markdown>
<script type="text/template">
## Controle de Versão
<div style="position:relative; width:640px; height:480px; margin:0 auto;">
<img class="fragment fade-out" width="640" height="480" src="https://git-scm.com/figures/18333fig0101-tn.png" style="position:absolute;top:0;left:0;" data-fragment-index="0" />
<img class="fragment fade-in" width="640" height="480" src="img/vcs_example2.png" style="position:absolute;top:0;left:0;" data-fragment-index="1" />
</div>
</script>
</section>
<section data-markdown>
<script type="text/template">
## VCS Distribuido
<img src="https://git-scm.com/figures/18333fig0103-tn.png" alt="Exemplo VCS Distribuido" />
<aside class="notes">
- Sistemas de Controle de Versão Distribuídos (Distributed Version Control System ou DVCS). <br/>
- Exemplos: Git, Mercurial, Bazaar ou Darcs; <br/>
- Os clientes não apenas fazem cópias das últimas versões dos arquivos: eles são cópias completas do repositório; <br/>
- Se um servidor falha, qualquer um dos repositórios dos clientes pode ser copiado de volta para o servidor para restaurá-lo; <br/>
- Cada checkout (resgate) é na prática um backup completo de todos os dados.
</aside>
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Instalando o GIT
</script>
</section>
<section data-markdown>
<script type="text/template">
## No Windows
[Pelo site do Git](https://git-scm.com/downloads)
<br />
<img src="img/dwl_git_windows.png" alt="Página de Dowload do Git" height="500"/>
</script>
</section>
<section data-markdown>
<script type="text/template">
## No Linux
```bash
$ sudo apt-get update
$ sudo apt-get install git
```
</script>
</section>
<section data-markdown>
<script type="text/template">
## No Mac OSX
Verificar se já não está instalado
```bash
$ git --version
git version 2.9.2
```
Pelo Homebrew
```bash
$ brew install git
```
Pelo MacPorts
```bash
$ port search git
$ port variants git
$ sudo port install git +bash_completion+credential_osxkeychain+doc
```
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Configurando o Git
```bash
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
```
</script>
</section>
<section data-markdown>
<script type="text/template">
## Configurações diferentes
Sistema
```bash
$ git config --system --list
# /etc/gifconfig
# C:\ProgramData\Git\config no Windows Vista pra cima
```
Usuário
```bash
$ git config --global --list
# ~/.gitconfig ou em $HOME/ no Windows,
# que costuma ser C:\Users\$USER
```
Projeto
```bash
$ git config --list
# .git/config na pasta do projeto em que você rodou o comando
```
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Usando o Github
</script>
</section>
<section data-markdown>
<script type="text/template">
## Criando uma conta!
<img src="img/github.png" alt="Página Inicial do Github" height="500"/>
</script>
</section>
<section data-markdown>
<script type="text/template">
## Criando um repositório
<img src="https://guides.github.com/activities/hello-world/create-new-repo.png"/>
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Começando um projeto Git
Git Init
<img src="img/git_init.png" alt="Executando o comando git init" height="500"/>
</script>
</section>
<section data-markdown>
<script type="text/template">
Git Clone
<img src="img/git_clone.png" alt="Executando o comando git clone" height="500"/>
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Começando um projeto Git
Git Status
<img src="img/git_status.png" alt="Executando o comando git Status" height="500"/>
</script>
</section>
<section data-markdown>
<script type="text/template">
Git Status [2]
<img src="img/git_status2.png" alt="Executando o comando git status" height="500"/>
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Estados de um arquivo
- Untracked
- Not Staged for Commit
- Staged for Commit
<img src="https://git-scm.com/book/en/v2/book/02-git-basics/images/lifecycle.png" alt="Diagrama dos estados de um arquivo"/>
</script>
</section>
<section data-markdown>
<script type="text/template">
Untracked
```bash
# Vamos criar um arquivo novo, vazio
$ touch new_file.txt
```
<img src="img/git_untracked.png" alt="Exemplo de um arquivo untracked no git status" height="500" />
</script>
</section>
<section data-markdown>
<script type="text/template">
Not Staged for commit
<img src="img/git_not_staged.png" alt="Exemplo de um arquivo not staged no git status" height="500"/>
</script>
</section>
<section data-markdown>
<script type="text/template">
Staged for commit
```bash
$ git add README.md
```
<img src="img/git_staged.png" alt="Exemplo de um arquivo staged no git status" height="500"/>
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Criando um Commit
<img src="img/arvore.png" alt="Exemplo de master antes de um commit"/>
</script>
</section>
<section data-markdown>
<script type="text/template">
Git Commit
<img src="img/git_commit.png" alt="Exemplo de master antes de um commit"/>
</script>
</section>
<section data-markdown>
<script type="text/template">
Resultado
<img src="img/arvore2.png" alt="Exemplo de master depois de um commit"/>
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Entendendo os Remotes
```bash
# Lista os remotes cadastrados
$ git remote -v
origin https://github.com/lucasaciole/hello-git-example.git (fetch)
origin https://github.com/lucasaciole/hello-git-example.git (push)
```
</script>
</section>
<section data-markdown>
<script type="text/template">
## Cadastrando um Remote
```bash
# Cria um novo remote
$ git remote add <nome> <URI>
# Lista os remotes cadastrados
$ git remote -v
origin https://github.com/lucasaciole/hello-git-example.git (fetch)
origin https://github.com/lucasaciole/hello-git-example.git (push)
<nome> <URI> (fetch)
<nome> <URI> (push)
```
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Enviando para o servidor
<img src="img/arvore2.png" alt="Exemplo de master depois de um commit"/>
<img src="img/github1.png" alt="Pagina do repositório no Github antes do push"/>
</script>
</section>
<section data-markdown>
<script type="text/template">
Git push (HTTPS)
<img src="img/git_push.png" alt="Exemplo de um comando git push" height="500"/>
</script>
</section>
<section data-markdown>
<script type="text/template">
Resultado
<img src="img/arvore3.png" alt="Exemplo de master depois de um commit"/>
<img src="img/github2.png" alt="Pagina do repositório no Github antes do push"/>
</script>
</section>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Git Branchs
<img src="img/git_branches.png" alt="Exemplo de duas branches no repositório"/>
</script>
</section>
<section data-markdown>
<script type="text/template">
Criando uma branch
<img src="img/git_branch.png" alt="Pagina do repositório no Github antes do push"/>
</script>
</section>
<section data-markdown>
<script type="text/template">
Criando + Navegando para a branch
<img src="img/git_checkout.png" alt="Pagina do repositório no Github antes do push"/>
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Entrando em detalhes
Um arquivo Staged e Not Staged ao mesmo tempo
<div style="position:relative; width:640px; height:480px; margin:0 auto;">
<img class="fragment fade-out" width="640" height="126" src="img/readme_edit.png" style="position:absolute;top:0;left:0;" data-fragment-index="0" />
<img class="fragment fade-in" width="640" height="480" src="img/git_status4.png" style="position:absolute;top:0;left:0;" data-fragment-index="1" />
</div>
</script>
</section>
<section data-markdown>
<script type="text/template">
## Entrando em detalhes
Um arquivo Staged e Not Staged ao mesmo tempo
<div style="position:relative; width:640px; height:480px; margin:0 auto;">
<img class="fragment fade-out" width="640" height="164" src="img/readme_edit2.png" style="position:absolute;top:0;left:0;" data-fragment-index="0" />
<img class="fragment fade-in" width="640" height="480" src="img/git_status5.png" style="position:absolute;top:0;left:0;" data-fragment-index="1" />
</div>
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Conhecendo comandos úteis
Git Log
```bash
$ git log
```
<img src="img/git_log.png" alt="Exemplo do comando git log" />
</script>
</section>
<section data-markdown>
<script type="text/template">
## Conhecendo comandos úteis
Git Diff
```bash
# Mostra a diferença entre (Branch + Staged) e Not Staged
$ git diff README.md
```
<img src="img/git_diff.png" alt="Exemplo do comando git diff" />
</script>
</section>
<section data-markdown>
<script type="text/template">
## Conhecendo comandos úteis
Git Blame
```bash
# Exibe quem fez a ultima modificação em cada linha de um arquivo
# e o commit que contém a alteração
$ git blame README.md
```
<img src="img/git_blame.png" alt="Exemplo do comando git blame" />
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Cuidando bem do seu repositório
1. Commitar com frequência
2. Commitar alterações em pequenas partes
3. Escrever bons commits
</script>
</section>
<section data-markdown>
<script type="text/template">
## Regras de ouro para uma boa mensagem de commit
1. Separar "corpo" do "assunto" por uma linha em branco
2. Limitar o "assunto" até 50 caracteres
3. Capitalizar o assunto
4. Não termine o assunto com ponto final
5. Use o imperativo no assunto
6. Limite as linhas do corpo até 72 caracteres
7. Use o corpo para explicar o que foi feito e porquê vs. como
</script>
</section>
<section data-markdown>
<script type="text/template">
## Uma boa mensagem de commit
```markdown
Resuma as mudanças no "assunto" em até 50 caracteres
Pulando uma linha, comece o "corpo" do commit explicando mais
detalhadamente o que ele faz, SE NECESSÁRIO. Pule a linha toda
vez que ela chegar em torno dos 72 caracteres.
Explique o problema que você está resolvendo, tentando se
concentrar mais no motivo do que em como você o resolveu
(o código já cuida dessa parte).
O corpo do commit pode ser extendido em vários parágrafos,
inclusive utilizando listas:
- Normalmente os pontos de uma lista são representados
por um hífen ou;
* um asterisco;
Note como até mesmo nesse exemplo o fato de eu limitar as
linhas do corpo em 72 caracteres tornam a leitura muito mais
fácil.
Para terminar, coloque no final do corpo uma assinatura sua
para que projetos mais exigentes aceitem seus commits.
Você também pode colocar referências a pull requests ou issues
do Github:
Signed-off by: Author <autor.email@path.to.email>
Fixes: #1
See also: #179, #178
```
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Conhecendo comandos (AVANÇADO)
```bash
# Sempre usar pull assim depois que você já fez algum
# commit sem dar pull
$ git pull --rebase
# Por segurança, sempre especificar o REMOTE e a BRANCH
$ git push <remote> <branch>
# Ao mergear uma branch na master, mantenha a estrutura
# daquela branch no histórico. Assim, quando você
# olhar novamente, vai saber que aqueles commits eram
# de uma outra branch que já foi removida por ter sido mergeada
$ git merge --no-ff
```
</script>
</section>
</section>
<section data-markdown>
<script type="text/template">
# Dúvidas
</script>
</section>
<section data-markdown>
<script type="text/template">
# Por hoje é só!
</script>
</section>
<section data-markdown>
<script type="text/template">
## Referências
[ProGIT](https://git-scm.com/book/en/v2 "https://git-scm.com/")
|
[Github](http://github.com/ "Github")
|
[Chris Beans](http://chris.beams.io/posts/git-commit/)
<br />
[Seth Robertson](https://sethrobertson.github.io/GitBestPractices/)
|
[Alex Kras](http://www.alexkras.com/19-git-tips-for-everyday-use)
|
[Atlassian](https://www.atlassian.com/git/tutorials/install-git/mac-os-x)
</script>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// More info https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: false,
history: true,
margin: 0.1,
// More info https://github.com/hakimel/reveal.js#dependencies
dependencies: [
{ src: 'plugin/markdown/marked.js' },
{ src: 'plugin/markdown/markdown.js' },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }
]
});
</script>
</body>
</html>