This repository has been archived by the owner on Nov 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tex
791 lines (664 loc) · 22.3 KB
/
main.tex
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
\documentclass[12pt,utf8]{beamer}
% Gute Einführung zu LaTeX-Beamer: http://www2.informatik.hu-berlin.de/~mischulz/beamer.html
%-----PARAMETERS-----
%Wichtige Standard Pakete!
%\usepackage[german]{babel}
\usepackage{ngerman}
\usepackage{xcolor}
\usepackage{graphicx}
%\usepackage{subcaption}
\usepackage{tikz}
%Für den Header notwendig!
%\usepackage[percent]{overpic}
\usepackage{hyperref} % für korrekte Links
%Einbinden des Themes
\input{design_latex-template/beamerthemeFOSSAG.sty}
%Standard Angaben
\title{
\hspace*{8cm}
\includegraphics[scale=0.2]{resources/logo_500px.png}
\newline
FOSS-AG
}
\subtitle{Git}
\author{\footnotesize{@chef\_excellence}}
\institute[FOSS AG]{\textbf{F}ree and \textbf{O}pen \textbf{S}ource \textbf{S}oftware \textbf{AG}}
%-----IMPLEMENTATION-----
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\begin{figure}
\centering
\includegraphics[scale=0.1]{resources/cc.png}
\includegraphics[scale=0.1]{resources/by.png}
\includegraphics[scale=0.1]{resources/sa.png}
\end{figure}
\centering
Attribution-ShareAlike 4.0 International\\(CC BY-SA 4.0)
\end{frame}
\begin{frame}
\frametitle{Was ist Git?}
\begin{itemize}
\item Version Control System
\item erlaubt verteilte Softwareentwicklung
\end{itemize}
\end{frame}
\begin{frame}
\begin{figure}
\centering
\includegraphics[scale=0.5]{resources/subversion.png}
\includegraphics[scale=0.2]{resources/git.png}
\includegraphics[scale=0.6]{resources/mercurial.png}
\tiny{\cite{subversion}}
\tiny{\cite{git_logo}}
\tiny{\cite{mercurial}}
\end{figure}
\end{frame}
\begin{frame}
\frametitle{Was macht Git anders?}
\centering
In a nutshell:\\
\textbf{Snapshots statt Diffs}
\end{frame}
\begin{frame}
\frametitle{Diffs}
\begin{figure}[h]
\centering
\begin{tikzpicture}
\tikzstyle{version} = []
\tikzstyle{file}=[draw, minimum size=25pt]
\tikzstyle{diff}=[circle, draw, minimum size=25pt]
\tikzset{edge/.style = {->,> = latex}}
% versions
\node[version](v1) at (0,1.5) {v1};
\node[version](v2) at (2,1.5) {v2};
\node[version](v3) at (4,1.5) {v3};
\node[version](v4) at (6,1.5) {v4};
\node[version](v5) at (8,1.5) {v5};
% file A + diffs
\node[file](A) at (0,0) {A};
\node[diff](DA1) at (2,0) {$\Delta_1$};
\node[diff](DA2) at (6,0) {$\Delta_2$};
\draw[edge](A) to (DA1);
\draw[edge](DA1) to (DA2);
% file B + diffs
\node[file](B) at (0,-1.5) {B};
\node[diff](DB1) at (4,-1.5) {$\Delta_1$};
\draw[edge](B) to (DB1);
% file C + diffs
\node[file](C) at (2,-3) {C};
\node[diff](DC1) at (4,-3) {$\Delta_1$};
\node[diff](DC2) at (8,-3) {$\Delta_2$};
\draw[edge](C) to (DC1);
\draw[edge](DC1) to (DC2);
\end{tikzpicture}
\end{figure}
\end{frame}
\begin{frame}
\frametitle{Snapshots}
\begin{figure}[h]
\centering
\begin{tikzpicture}
\tikzstyle{version} = []
\tikzstyle{file}=[draw, minimum size=25pt]
\tikzstyle{link} = [dash pattern=on 3pt off 3pt, draw, minimum size=25pt]
\tikzset{edge/.style = {-,> = latex, dashed}}
% versions
\node[version](v1) at (0,1.5) {v1};
\node[version](v2) at (2,1.5) {v2};
\node[version](v3) at (4,1.5) {v3};
\node[version](v4) at (6,1.5) {v4};
\node[version](v5) at (8,1.5) {v5};
% file A + diffs
\node[file](A) at (0,0) {A};
\node[file](A1) at (2,0) {A$_1$};
\node[link](linkA1) at (4,0) {A$_1$};
\node[file](A2) at (6,0) {A$_2$};
\node[link](linkA2) at (8,0) {A$_2$};
\draw[edge](linkA1) to (A1);
\draw[edge](linkA2) to (A2);
% file B + diffs
\node[file](B) at (0,-1.5) {B};
\node[link](linkB) at (2,-1.5) {B};
\node[file](B1) at (4,-1.5) {B$_1$};
\node[link](linkB1) at (6,-1.5) {B$_1$};
\node[link](link1B1) at (8,-1.5) {B$_1$};
\draw[edge](linkB) to (B);
\draw[edge](linkB1) to (B1);
\draw[edge](link1B1) to (linkB1);
% file C + diffs
\node[file](C) at (2,-3) {C};
\node[file](C1) at (4,-3) {C$_1$};
\node[link](linkC1) at (6,-3) {C$_1$};
\node[file](C2) at (8,-3) {C$_2$};
\draw[edge](linkC1) to (C1);
\end{tikzpicture}
\end{figure}
\end{frame}
% Vorteile von Snapshots sind besonders stark, wenn es um Branching geht
\begin{frame}
\frametitle{Git ist schnell!}
\begin{itemize}
\item Geschwindigkeitsvorteil gegenüber vielen anderen VCSs
\item Fast alle Operationen finden lokal statt und benötigen keine Kommunikation mit einem Server
\begin{itemize}
\item Git-History durchsuchen
\item auf ein alte Revision wechseln
\item Änderungen am Projekt commiten
\end{itemize}
\item[$\Rightarrow$] Kein Overhead durch Netzwerkkommunikation
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Support your local repo}
\begin{itemize}
\item Arbeiten und commiten auf lokaler Kopie des Projekts
\item \texttt{git push} schiebt Änderung auf den Server
\item[$\Rightarrow$] erlaubt dezentralisiertes und lokales Arbeiten
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Git vs. SVN}
\begin{itemize}
\item Änderungen der Datei sind offline möglich
\item keine lokalen Commits möglich
\item \texttt{svn commit} = \texttt{git commit + git push}
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Die Dreifaltigkeit Gits}
Jede Datei im Repository hat einen von drei Zustände:
\begin{itemize}
\item Modified\\
Die Datei wurde verändert und entspricht nicht mehr der Version des momentanen Snapshots
\item Staged\\
Die Datei wurde für den nächsten Commit vorgemerkt und wird Teil des nächsten Snapshots
\item Commited\\
Die Datei wurde zum neuen Snapshot hinzugefügt und ist in der lokalen Datenbank gespeichert
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Grundlegender Workflow}
\begin{enumerate}
\item Hack Hack Hack
\item Hinzufügen der veränderten Dateien zur Staging Area\\
\texttt{git add FILES}
\item Erstellen des neuen Snapshots (lokal)\\
\texttt{git commit -m COMMIT\_MESSAGE}
\item Schiebe alle Änderungen auf den Server\\
\texttt{git push}
\end{enumerate}
\end{frame}
\begin{frame}
\frametitle{Statusbericht}
\begin{itemize}
\item Der Zustand der Dateien kann mit \texttt{git status -s} überprüft werden\\
\item Zeigt zusätzlich auch Dateien an, die nicht zum Projekt gehören (untracked files)
\end{itemize}
\end{frame}
\begin{frame}
\begin{figure}
\includegraphics[scale=0.6]{resources/sponge.jpg}
\tiny{\cite{sponge}}
\end{figure}
\end{frame}
\begin{frame}
\frametitle{.gitignore}
Manche Dateien will man bewusst nicht hinzufügen
\begin{itemize}
\item[$\Rightarrow$] \texttt{.gitignore}
\begin{itemize}
\item Füge einzelne Dateien hinzu, die von Git ignoriert werden sollen
\item Reguläre Ausdrücke können verwendet werden, um z.B. alle Dateien eines bestimmten Formats auszuschliessen
\end{itemize}
\end{itemize}
Sammlung an Templates: \url{https://github.com/github/gitignore}
\end{frame}
\begin{frame}
\frametitle{Branching}
\begin{itemize}
\item Fast jedes VCS hat eine Art des Branching
\item Git's Branching ist leichtgewichtig und schnell!
\item Kein Kopieren von Dateien nötig!
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Branching - Beispiel}
Unser Projekt besteht aus 3 Dateien:
\begin{itemize}
\item[] \texttt{README}
\item[] \texttt{LICENSE}
\item[] \texttt{test.rb}
\end{itemize}
\texttt{git add README LICENSE test.rb}\\
\texttt{git commit -m 'The initial commit of my project'}
\end{frame}
\begin{frame}
\begin{figure}
\includegraphics[scale=0.4]{resources/commit-and-tree.png}
\tiny{\cite{commit-and-tree}}
\end{figure}
\end{frame}
\begin{frame}
\begin{figure}
\includegraphics[scale=0.4]{resources/commits-and-parents.png}
\tiny{\cite{commit-and-parents}}
\end{figure}
\end{frame}
\begin{frame}
\frametitle{Branching - Beispiel}
\begin{itemize}
\item Jeder Commit wird als Baum repräsentiert, der Informationen über den jeweiligen Snapshot abspeichert
\begin{itemize}
\item Autor
\item Commit message
\item Hashes
\end{itemize}
\item Jeder Commit wird an die Liste der bisherigen Commits angefügt
\end{itemize}
$\Rightarrow$ ein Branch ist ein Pointer auf einen Commit
\end{frame}
\begin{frame}
\frametitle{HEAD-master}
\begin{itemize}
\item \texttt{master}:\\
Keine besondere Stellung!\\
Bennenung erfolgt automatisch durch \texttt{git init}
\item \texttt{HEAD}:\\
Zeiger auf den Branch auf dem man lokal arbeitet.
\end{itemize}
\end{frame}
\begin{frame}
\begin{figure}[h]
\centering
\begin{tikzpicture}
\tikzstyle{version} = []
\tikzstyle{branch}=[draw, minimum size=25pt]
\tikzstyle{commit} = [dash pattern=on 3pt off 3pt, draw, minimum size=25pt]
\tikzset{edge/.style = {-,-> = latex}}
\node[commit](commit1) at (0,0) {92ec2};
\node[commit](commit2) at (3,0) {184ca};
\node[commit](commit3) at (6,0) {0de24};
\draw[edge](commit2) to (commit1);
\draw[edge](commit3) to (commit2);
\node[branch](master) at (6,2) {\texttt{master}};
\draw[edge](master) to (commit3);
\end{tikzpicture}
\end{figure}
\end{frame}
\begin{frame}
\begin{figure}[h]
\centering
\begin{tikzpicture}
\tikzstyle{head} = []
\tikzstyle{branch}=[draw, minimum size=25pt]
\tikzstyle{commit} = [dash pattern=on 3pt off 3pt, draw, minimum size=25pt]
\tikzset{edge/.style = {-,-> = latex}}
\node[commit](commit1) at (0,0) {92ec2};
\node[commit](commit2) at (3,0) {184ca};
\node[commit](commit3) at (6,0) {0de24};
\draw[edge](commit2) to (commit1);
\draw[edge](commit3) to (commit2);
\node[branch](master) at (6,2) {\texttt{master}};
\draw[edge](master) to (commit3);
\node[head](head) at (6,4) {\texttt{HEAD}};
\draw[edge](head) to (master);
\end{tikzpicture}
\end{figure}
\end{frame}
\begin{frame}
\begin{figure}[h]
\centering
\begin{tikzpicture}
\tikzstyle{head} = []
\tikzstyle{branch}=[draw, minimum size=25pt]
\tikzstyle{commit} = [dash pattern=on 3pt off 3pt, draw, minimum size=25pt]
\tikzset{edge/.style = {-,-> = latex}}
\node[commit](commit1) at (0,0) {92ec2};
\node[commit](commit2) at (3,0) {184ca};
\node[commit](commit3) at (6,0) {0de24};
\draw[edge](commit2) to (commit1);
\draw[edge](commit3) to (commit2);
\node[branch](master) at (6,2) {\texttt{master}};
\draw[edge](master) to (commit3);
\node[branch](testing) at (6,-2) {\texttt{testing}};
\draw[edge](testing) to (commit3);
\node[head](head) at (6,4) {\texttt{HEAD}};
\draw[edge](head) to (master);
\end{tikzpicture}
\end{figure}
Erstellen eines \texttt{testing} Branch.
\end{frame}
\begin{frame}
\begin{figure}[h]
\centering
\begin{tikzpicture}
\tikzstyle{head} = []
\tikzstyle{branch}=[draw, minimum size=25pt]
\tikzstyle{commit} = [dash pattern=on 3pt off 3pt, draw, minimum size=25pt]
\tikzset{edge/.style = {-,-> = latex}}
\node[commit](commit1) at (0,0) {92ec2};
\node[commit](commit2) at (3,0) {184ca};
\node[commit](commit3) at (6,0) {0de24};
\draw[edge](commit2) to (commit1);
\draw[edge](commit3) to (commit2);
\node[branch](master) at (6,2) {\texttt{master}};
\draw[edge](master) to (commit3);
\node[branch](testing) at (6,-2) {\texttt{testing}};
\draw[edge](testing) to (commit3);
\node[head](head) at (6,-4) {\texttt{HEAD}};
\draw[edge](head) to (testing);
\end{tikzpicture}
\end{figure}
Wechseln auf den \texttt{testing} Branch.
\end{frame}
\begin{frame}
\begin{figure}[h]
\centering
\begin{tikzpicture}
\tikzstyle{head} = []
\tikzstyle{branch}=[draw, minimum size=25pt]
\tikzstyle{commit} = [dash pattern=on 3pt off 3pt, draw, minimum size=25pt]
\tikzset{edge/.style = {-,-> = latex}}
\node[commit](commit1) at (0,0) {92ec2};
\node[commit](commit2) at (3,0) {184ca};
\node[commit](commit3) at (6,0) {0de24};
\node[commit](commit4) at (9,0) {87fa1};
\draw[edge](commit2) to (commit1);
\draw[edge](commit3) to (commit2);
\draw[edge](commit4) to (commit3);
\node[branch](master) at (6,2) {\texttt{master}};
\draw[edge](master) to (commit3);
\node[branch](testing) at (9,-2) {\texttt{testing}};
\draw[edge](testing) to (commit4);
\node[head](head) at (9,-4) {\texttt{HEAD}};
\draw[edge](head) to (testing);
\end{tikzpicture}
\end{figure}
Commit auf dem \texttt{testing} Branch.
\end{frame}
\begin{frame}
\begin{figure}[h]
\centering
\begin{tikzpicture}
\tikzstyle{head} = []
\tikzstyle{branch}=[draw, minimum size=25pt]
\tikzstyle{commit} = [dash pattern=on 3pt off 3pt, draw, minimum size=25pt]
\tikzset{edge/.style = {-,-> = latex}}
\node[commit](commit1) at (0,0) {92ec2};
\node[commit](commit2) at (3,0) {184ca};
\node[commit](commit3) at (6,0) {0de24};
\node[commit](commit4) at (9,0) {87fa1};
\draw[edge](commit2) to (commit1);
\draw[edge](commit3) to (commit2);
\draw[edge](commit4) to (commit3);
\node[branch](master) at (6,2) {\texttt{master}};
\draw[edge](master) to (commit3);
\node[branch](testing) at (9,-2) {\texttt{testing}};
\draw[edge](testing) to (commit4);
\node[head](head) at (6,4) {\texttt{HEAD}};
\draw[edge](head) to (master);
\end{tikzpicture}
\end{figure}
Wechseln auf den \texttt{master} Branch.
\end{frame}
\begin{frame}
\begin{figure}[h]
\centering
\begin{tikzpicture}
\tikzstyle{head} = []
\tikzstyle{branch}=[draw, minimum size=25pt]
\tikzstyle{commit} = [dash pattern=on 3pt off 3pt, draw, minimum size=25pt]
\tikzset{edge/.style = {-,-> = latex}}
\node[commit](commit1) at (0,0) {92ec2};
\node[commit](commit2) at (3,0) {184ca};
\node[commit](commit3) at (6,0) {0de24};
\node[commit](commit4) at (9,-1) {87fa1};
\node[commit](commit5) at (9, 1) {76e0c};
\draw[edge](commit2) to (commit1);
\draw[edge](commit3) to (commit2);
\draw[edge](commit4) to (commit3);
\draw[edge](commit5) to (commit3);
\node[branch](master) at (9,2.5) {\texttt{master}};
\draw[edge](master) to (commit5);
\node[branch](testing) at (9,-2.5) {\texttt{testing}};
\draw[edge](testing) to (commit4);
\node[head](head) at (9,4) {\texttt{HEAD}};
\draw[edge](head) to (master);
\end{tikzpicture}
\end{figure}
Commit auf dem \texttt{master} Branch.
\end{frame}
\begin{frame}
\frametitle{Branch vs Fork}
\begin{itemize}
\item Ein Fork ist eine echte Kopie eines Git Repositories
\item Forks bieten sich immer dann an, wenn man keine Schreibrechte auf einem Repository hat
\item Merge-/Pull-Request um Forks zu vereinen
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Merge}
\begin{itemize}
\item Die Merge-funktion erlaubt es Branches/Forks zusammenzuführen
\end{itemize}
\end{frame}
\begin{frame}
\begin{figure}[h]
\centering
\begin{tikzpicture}
\tikzstyle{head} = []
\tikzstyle{branch}=[draw, minimum size=25pt]
\tikzstyle{commit} = [dash pattern=on 3pt off 3pt, draw, minimum size=25pt]
\tikzset{edge/.style = {-,-> = latex}}
\node[commit](commit1) at (0,0) {92ec2};
\node[commit](commit2) at (3,0) {184ca};
\node[commit](commit3) at (6,0) {0de24};
\node[commit](commit4) at (9,-1) {87fa1};
\node[commit](commit5) at (9, 1) {76e0c};
\draw[edge](commit2) to (commit1);
\draw[edge](commit3) to (commit2);
\draw[edge](commit4) to (commit3);
\draw[edge](commit5) to (commit3);
\node[branch](master) at (6,2.5) {\texttt{master}};
\draw[edge](master) to (commit3);
\node[branch](issue) at (9,2.5) {\texttt{issue}};
\draw[edge](issue) to (commit5);
\node[branch](testing) at (9,-2.5) {\texttt{testing}};
\draw[edge](testing) to (commit4);
\end{tikzpicture}
\end{figure}
\end{frame}
\begin{frame}
\frametitle{Merge}
\begin{itemize}
\item Fehler im Projekt gefunden
\item Öffne \texttt{issue} Branch, um Fehler zu beheben
\item Fehler behoben. Merge \texttt{master} und \texttt{issue}.
\end{itemize}
\texttt{git checkout master\\git merge issue}
\end{frame}
\begin{frame}
\begin{figure}[h]
\centering
\begin{tikzpicture}
\tikzstyle{head} = []
\tikzstyle{branch}=[draw, minimum size=25pt]
\tikzstyle{commit} = [dash pattern=on 3pt off 3pt, draw, minimum size=25pt]
\tikzset{edge/.style = {-,-> = latex}}
\node[commit](commit1) at (0,0) {92ec2};
\node[commit](commit2) at (3,0) {184ca};
\node[commit](commit3) at (6,0) {0de24};
\node[commit](commit4) at (9,-1) {87fa1};
\node[commit](commit5) at (9, 1) {76e0c};
\draw[edge](commit2) to (commit1);
\draw[edge](commit3) to (commit2);
\draw[edge](commit4) to (commit3);
\draw[edge](commit5) to (commit3);
\node[branch](master) at (6,2.5) {\texttt{master}};
\draw[edge](master) to (commit5);
\node[branch](issue) at (9,2.5) {\texttt{issue}};
\draw[edge](issue) to (commit5);
\node[branch](testing) at (9,-2.5) {\texttt{testing}};
\draw[edge](testing) to (commit4);
\end{tikzpicture}
\end{figure}
''fast-forward''-Merge von \texttt{master} und \texttt{issue}.
\end{frame}
\begin{frame}
\frametitle{Fast-Forward-Merge}
\begin{itemize}
\item fast forwarding: Umlenken des \texttt{master} Zeigers reicht für Merge aus
\item Keine Konfilkte da auf dem selben Pfad im Baum
\item andere Branch kann danach in der Regel gelöscht werden
\end{itemize}
\texttt{git branch -d issue}
\end{frame}
\begin{frame}
\begin{figure}[h]
\centering
\begin{tikzpicture}
\tikzstyle{head} = []
\tikzstyle{branch}=[draw, minimum size=25pt]
\tikzstyle{commit} = [dash pattern=on 3pt off 3pt, draw, minimum size=25pt]
\tikzset{edge/.style = {-,-> = latex}}
\node[commit](commit1) at (0,0) {92ec2};
\node[commit](commit2) at (3,0) {184ca};
\node[commit](commit3) at (6,0) {0de24};
\node[commit](commit4) at (9,-1) {87fa1};
\node[commit](commit5) at (9, 1) {76e0c};
\draw[edge](commit2) to (commit1);
\draw[edge](commit3) to (commit2);
\draw[edge](commit4) to (commit3);
\draw[edge](commit5) to (commit3);
\node[branch](master) at (9,2.5) {\texttt{master}};
\draw[edge](master) to (commit5);
\node[branch](testing) at (9,-2.5) {\texttt{testing}};
\draw[edge](testing) to (commit4);
\end{tikzpicture}
\end{figure}
Löschen des \texttt{issue} Branch.
\end{frame}
\begin{frame}
\begin{figure}
\centering
\includegraphics[scale=0.35]{resources/dbz-fusion.png}
\tiny{\cite{dragonballz}}
\end{figure}
\end{frame}
\begin{frame}
\begin{figure}
\centering
\includegraphics[scale=0.5]{resources/liquid-slam.jpg}
\tiny{\cite{liquidslam}}
\end{figure}
\end{frame}
\begin{frame}
\begin{figure}[h]
\centering
\begin{tikzpicture}
\tikzstyle{head} = []
\tikzstyle{branch}=[draw, minimum size=25pt]
\tikzstyle{commit} = [dash pattern=on 3pt off 3pt, draw, minimum size=25pt]
\tikzset{edge/.style = {-,-> = latex}}
\node[head](history)at (0,0) {...};
\node[commit](commit3) at (3,0) {0de24};
\node[commit](commit4) at (6,-1) {87fa1};
\node[commit](commit5) at (6, 1) {76e0c};
\draw[edge](commit3) to (history);
\draw[edge](commit4) to (commit3);
\draw[edge](commit5) to (commit3);
\node[branch](master) at (6,2.5) {\texttt{master}};
\draw[edge](master) to (commit5);
\node[branch](testing) at (6,-2.5) {\texttt{testing}};
\draw[edge](testing) to (commit4);
\end{tikzpicture}
\end{figure}
Merge \texttt{testing} und \texttt{master}.
\end{frame}
\begin{frame}
\frametitle{Three-Way-Merge}
\begin{itemize}
\item Merge \texttt{master} und \texttt{testing} mit Hilfe eines gemeinsamen vorhergehenden Knotens
\item Erzeuge neuen Commit, der sowohl die beiden Commits als Elternknoten hat und verschiebe \texttt{master}.
\item Lösche \texttt{testing}, da nicht weiter benötigt.
\end{itemize}
\end{frame}
\begin{frame}
\begin{figure}[h]
\centering
\begin{tikzpicture}
\tikzstyle{head} = []
\tikzstyle{branch}=[draw, minimum size=25pt]
\tikzstyle{commit} = [dash pattern=on 3pt off 3pt, draw, minimum size=25pt]
\tikzset{edge/.style = {-,-> = latex}}
\node[head](history)at (0,0) {...};
\node[commit](commit3) at (3,0) {0de24};
\node[commit](commit4) at (6,-1) {87fa1};
\node[commit](commit5) at (6, 1) {76e0c};
\node[commit](commit6) at (9,0) {6ef23};
\draw[edge](commit3) to (history);
\draw[edge](commit4) to (commit3);
\draw[edge](commit5) to (commit3);
\draw[edge](commit6) to (commit4);
\draw[edge](commit6) to (commit5);
\node[branch](master) at (9,2.5) {\texttt{master}};
\draw[edge](master) to (commit6);
\end{tikzpicture}
\end{figure}
\end{frame}
\begin{frame}
\frametitle{Three-Way-Merge}
\begin{itemize}
\item Geht nicht immer ganz reibungslos $\rightarrow$ Merge-Konfilkte
\item Git markiert die Stellen die in Konflikt stehen
\item Manuelles lösen der Konflikte nötig
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Git Workflow}
\begin{itemize}
\item Änderungen an lokalem Branch vornehmen (\texttt{git add})
\begin{itemize}
\item Jeder Task sollte seinen eigenen Branch haben\\ (\texttt{git checkout -b BRANCH})
\end{itemize}
\item Lokale Snapshots erstellen (\texttt{git commit})
\item Snapshots auf den Server laden (\texttt{git push})
\item Merge mit \texttt{master}-Branch (\texttt{git merge BRANCH})
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Git Inside}
\begin{itemize}
\item Viele Dienste erweitern Git um eigene Funktion:
\begin{itemize}
\item Issue Tracker
\item Code Dokumentation
\item Merge-/Pull-Requests
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Issue Tracker}
\begin{itemize}
\item Verwaltung von Feature-Requests und Bugs
\item Diskussionsplattform
\item Weise Issues Branches und Personen zu
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Merge-/Pull-Requests}
\begin{itemize}
\item Möglichkeit einen Merge zu beantragen
\item Mehr-Augen-Prinzip: Merge muss angenommen werden
\item Diskussion über Merge möglich
\end{itemize}
\end{frame}
\begin{frame}
\bibliographystyle{plain}
\tiny\bibliography{literatur}
\addcontentsline{toc}{section}{\bibname}
\end{frame}
\end{document}