-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfsfw-git-ws.tex
1464 lines (1235 loc) · 39.4 KB
/
fsfw-git-ws.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
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass{beamer}
% \includeonlyframes{schluss20,schluss30}
\synctex=1
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{verbatim}
\usepackage{csquotes}
\usepackage{eurosym}
\usepackage{wasysym}
\usepackage{amssymb}
\MakeAutoQuote{„}{”}
\usepackage[absolute,overlay]{textpos} % for \textblock
\usepackage{fancyvrb}
\usepackage{newverbs}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{%
positioning,
calc,
}
\usepackage{gitdags}
% Zum Zeichnen von git-Graphen
% https://tex.stackexchange.com/a/198345/2381
% hängt ab von xcolor-solarized
% Zur Vermeidung von Komplierungsschwierigkeiten liegen xcolor-solarized.sty
% und gitdags.sty direkt im Hauptverzeichnis
\usepackage{lmodern}
\hypersetup{
colorlinks=true,
linkcolor=, %
urlcolor=[rgb]{.2, .2, .5} %
% allcolors=[rgb]{0, 0, 0} % schwarz
}
% boilerplate stuff to get colred background of \verb|...|
% quelle: https://tex.stackexchange.com/a/141128/2381
\definecolor{cverbbg}{gray}{0.93}
\newenvironment{cverbatim}
{\SaveVerbatim{cverb}}
{\endSaveVerbatim
\flushleft\fboxrule=0pt\fboxsep=.5em
\colorbox{cverbbg}{\BUseVerbatim{cverb}}%
\endflushleft
}
\newcommand{\ctexttt}[1]{\colorbox{cverbbg}{\texttt{#1}}}
\newverbcommand{\cverb}
{\setbox\verbbox\hbox\bgroup}
{\egroup\colorbox{cverbbg}{\box\verbbox}}
% end of colored verb boilerplate
\usetheme{Dresden}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[frame number]
\title{Versionsverwaltung mit git: Warum und wie.}
\subtitle{Erstsemester-Einführung Informatik, 07.10.2019}
\addtobeamertemplate{frametitle}{}{%
\begin{textblock*}{130mm}(.963\textwidth,8.4mm)
\includegraphics[width=2.25cm]{img-src/fsfw-logo.pdf}
\end{textblock*}
}
\begin{document}
\begin{frame}
\begin{center}%
\includegraphics[width=3cm]{img-src/fsfw-logo-with-text.pdf}\\
\vspace*{-0.5\baselineskip}
\parbox{.95\columnwidth}{\centering\Large\inserttitle}
\vspace*{\baselineskip}
\structure{\large \insertsubtitle}
\end{center}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[label=wb]
\begin{center}
\vspace{10mm}
\structure{\Huge <Eigenwerbung>}
\end{center}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[label=ct1]
\frametitle{Wer sind wir?}
\onslide<+->
\begin{itemize}
\item Hochschulgruppe an der TU (gegründet 2014, ca. 7 P.)
\item Studierende (TU, HTW) und andere Leute
\item Hochschulen als Zielgruppe (Multiplikationswirkung)\\
und Arbeitsfeld (Räume, Strukturen)
\bigskip\onslide<+->
\item Bisherige Projekte
\begin{itemize}
\item Linux-Install-Party, Linux-Presentation-Day
\item Verschlüsselungsgewinnspiel
\item Sprechstunde zu \LaTeX{} u.a.
\item Formulierung eines Programmpapiers
\item „Uni-Stick”: 130 $\times$ 8\,GB mit freier Software
\item Ringvorlesung: Freie Software und Freies Wissen als Beruf
\end{itemize}
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[label=ct2]
\frametitle{Warum machen wir das? Aus Überzeugung!}
\onslide<+->
\begin{itemize}
\item \emph{Überzeugung 1}: freie und quelloffene Software ist (oft) besser\\
(technische + nicht technische Argumente)\\
\bigskip\onslide<+->
\item \emph{Überzeugung 2}: öffentlich finanzierte wissenschaftliche Inhalte
(AutorInnen, GutachterInnen) sollten nicht von öffentlich finanzierten
Bibliotheken für horrende Summen von Zeitschriften-Verlagen gekauft werden
müssen
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[label=ct1b,t]
\frametitle{Projekt Uni-Stick (4. Auflage)}
\begin{itemize}
\item \textbf{3000} Flyer in Ersti-Tüten: \textbf{Gutscheine} für 8\,GB Stick mit freier Software
fürs Studium, Sticks-Beschaffung mit Geld von StuRä
\item Live-Linux / freie Windows-Programme
\pause
\item Vorbereitung: Arbeit + Spaß + Lernen
\pause
\item Ist gut angekommen (ca. 250 TN)
\end{itemize}
\begin{textblock*}{40mm}[0.,0.](83mm,42mm)
\visible<2->{
\includegraphics[width=40mm]{img-src/usb-hub}
}
\end{textblock*}
\begin{textblock*}{55mm}[0.,0.](15mm,57mm)
\visible<3->{
\includegraphics[width=55mm]{img-src/uni-stick-ausgabe-vortrag}
}
\end{textblock*}
\begin{textblock*}{55mm}[0.,0.](75mm,76mm)
\visible<4->{
Ausgabe: 4.11.2019 APB, E023\\
Infos/Anmeldung:
{\small \href{https://fsfw-dresden.de/uni-stick}{fsfw-dresden.de/uni-stick}}
}
\end{textblock*}
%
% \begin{textblock*}{55mm}[0.,0.](71mm,63mm)
% \visible<4->{
% \begin{itemize}
% \item Accessibility:
% \hspace{-5mm}
% \begin{itemize}
% \item brltty
% \item gnome-orca (Screenreader)
% \item ...
% \item WIP!
% \end{itemize}
% \end{itemize}
%
% }
% \end{textblock*}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[label=ct3]
\frametitle{Zukunftsideen}
\begin{itemize}
\item Fortführung "`Uni-Stick"'
\item Studierende zum Nutzen/Verbessern freier Software animieren
\begin{itemize}
\item Mehr Blog-Beiträge
\item Kurse (\LaTeX / Python /\textbf{ Git} / Inkscape / \dots)
\item Infrastruktur-Stipendium
\item OpenSource-Wettbewerb/Preis
\item \dots
\end{itemize}
\bigskip
\item Aufmerksamkeit erzeugen / Lobby-Arbeit ("`Landesverträge"')
\bigskip
\item Vernetzung mit anderen Städten
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[label=ct4]
\frametitle{Weitere Informationen}
\onslide<+->
\begin{center}
\url{https://fsfw-dresden.de/}
% HACK THE PLANET!
$\;\;\left\{\;\;\text{
\parbox{2.3cm}{
\texttt{uni-stick}\\[1mm]
\texttt{blog}\\[1mm]
\texttt{newsletter}
\texttt{mitmachen}\\[1mm]
\texttt{fork}\\[1mm]
\texttt{ringvorlesung}\\[2mm]
\texttt{\textbf{git-ws}}\\[-3mm]
}}
\right.$
\vspace*{2\bigskipamount}
\includegraphics[width=50mm]{img-src/fsfw-netzwerke}
\end{center}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[label=wb2]
\begin{center}
\vspace{10mm}
\structure{\Huge </Eigenwerbung>}
\end{center}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[label=ol1]
\frametitle{Gliederung}
\tableofcontents
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Warum Versionsverwaltung?}
\begin{frame}[label=why10]
\frametitle{Warum Versionsverwaltung?}
\begin{itemize}
\item Projekte bestehen aus schrittweisen Änderungen
\item Bedürfnis, zu vorherigem Zustand zurückkehren zu können
\begin{itemize}
\item ("`Savegame"')
\end{itemize}
\item Naiver Ansatz: \hspace{10mm}
\raisebox{-0.5\height}{\includegraphics[width=40mm]{img-src/my-software-dirs}}
\item Probleme:
\begin{itemize}
\item Speicherplatz
\item Fehlende Übersicht
\item Skaliert nicht (Teamwork)
\end{itemize}
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TODO: image source http://techidiocy.com/understand-git-clone-command-svn-checkout-vs-git-clone/
% https://softwareengineering.stackexchange.com/questions/136079/are-there-any-statistics-that-show-the-popularity-of-git-versus-svn
% http://www.wastedpotential.com/version-control-throwdown-git-vs-svn/
\section{Warum Git?}
\begin{frame}[label=why20]
\frametitle{Warum Git? (1)}
\begin{itemize}
\item Lösung 1: zentrale Versionsverwaltung
\begin{itemize}
\item CVS (1986), SVN (2000)
\item Idee: Zentrales Repositorium und Arbeitskopien \\[1ex]
\hspace*{1cm}\begin{tikzpicture}[%
node distance=2cm and 1cm,
location/.style={
% The shape:
rectangle,
% The size:
minimum size=6mm,
% The border:
very thick,
draw=red!50!black!50,
% 50% red and 50% black,
% and that mixed with 50% white
% The filling:
top color=white,
% a shading that is white at the top...
bottom color=red!50!black!20, % and something else at the bottom
},
checkout/.style={
<->,
shorten <=2pt,
shorten >=2pt,
thick,
color=black!40!white,
}]
]
\node[location, draw=green!50!black!50, bottom color=green!50!black!20] (repository) {SVN Repo};
\node[location] (user1) [below left of=repository] {Arbeitskopie 1};
\node[location] (user2) [below of=repository, yshift=-1ex] {Arbeitskopie 2};
\node[location] (user3) [below right of=repository] {Arbeitskopie 3};
\draw[checkout] ($ (repository.south) + (-2pt, 0) $) -- (user1.north);
\draw[checkout] (repository.south) -- (user2.north);
\draw[checkout] ($ (repository.south) + (2pt, 0) $) -- (user3.north);
\end{tikzpicture}
\end{itemize}
\item Probleme:
\begin{itemize}
\item Abhängig von Server-Erreichbarkeit
\item Performanz
\end{itemize}
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[label=why30]
\frametitle{Warum Git? (2)}
\begin{itemize}
\item Lösung 2: \textbf{de}zentrale Versionsverwaltung
\begin{itemize}
\item mercurial (2005), bazaar (2005) \textbf{git} (2005)
\item Idee: Jeder hat ein vollwertiges Repositorium \\[1ex]
\hspace*{1cm}\begin{tikzpicture}[%
node distance=2cm and 1cm,
location/.style={
% The shape:
rectangle,
% The size:
minimum size=6mm,
% The border:
very thick,
draw=green!50!black!50,
% 50% red and 50% black,
% and that mixed with 50% white
% The filling:
top color=white,
% a shading that is white at the top...
bottom color=green!50!black!20, % and something else at the bottom
},
checkout/.style={
<->,
shorten <=2pt,
shorten >=2pt,
thick,
color=black!40!white,
}]
]
\node[location] (user1) {Git Repo 1};
\node[location] (user2) [below left of=user1] {Git Repo 2};
\node[location] (user3) [below right of=user1] {Git Repo 3};
\draw[checkout] ($ (user1.south) + (-2pt, 0) $) -- (user2.north);
\draw[checkout] (user3.west) -- (user2.east);
\draw[checkout] ($ (user1.south) + (2pt, 0) $) -- (user3.north);
\end{tikzpicture}
\end{itemize}
\item Vorteile:
\begin{itemize}
\item Alle Operationen lokal $\rightarrow$ schnell, unabhängig
\item Einfaches "`branching"' und "`merging"'
\item ...
\end{itemize}
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[label=why40]
\frametitle{Warum Git? (3)}
\begin{textblock*}{\textwidth}[0.5,0.](60mm,20mm)
\begin{center}%
\only<1>{
\begin{figure}
\includegraphics[width=80mm]{img-src/svn-vs-git-boxing}
\end{figure}
}
\only<2->{
\begin{figure}
\includegraphics[width=80mm]{img-src/svn-vs-git-stats}\\
% \caption{Git and SVN \$WHATISPLOTTEDHERE} %% "Abbildung:" Unnötig
{Gefühlter Grad der Verbreitung: Git vs SVN}
\end{figure}
}
\bigskip
\visible<3->
{
Seit 2016: Git $\hat{=}$ defacto Standard
}
\end{center}
\end{textblock*}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Git Einführung (mit Praxis)}
\begin{frame}[label=ef1]
\frametitle{Einführung in git – Was ist ein Repo?}
\begin{columns}
\column{0.245\textwidth}
\begin{tikzpicture}
\gitDAG[grow down sep = 1em]{
A -- B -- C
};
\gitbranch{master}{left=of C}{C};
\gitHEAD{above=of master}{master}
\visible<4->{
\SAandWT
}
\end{tikzpicture}
\column{0.05\textwidth}
~
\column{0.75\textwidth}
\begin{itemize}
\item gerichteter, azyklischer Graph von Versionen
(\emph{revisions}) einer Ordnerstruktur und deren Inhalt mit
Metadaten (\emph{Commit-ID}, Autor, Beschreibungstext)
\item Commit-ID abgeleitet aus dem Inhalt und dem Graphen
(kryptographische Hash-Funktion)\\
\pause
{\tiny Beispiel: b52c95e791e1dac76b7f70292e366de7caa76178}
\item \emph{\texttt{HEAD}}: Knoten im Graphen; momentaner
Bezugspunkt für Operationen
\item \emph{refs}: referenzieren Knoten im Graphen (Beispiele:
\texttt{HEAD}, \texttt{HEAD\^{}3}, \texttt{master}, \texttt{my\_branch}, \texttt{b52c95e} {\tiny (abgekürzte
Commit-ID)})
\end{itemize}
\end{columns}
\begin{textblock*}{40mm}[0.,0.](30mm,27mm)
{\color<3->{gray}{\tiny
Start\\[7.5mm]
Nachfolger\\[6.5mm]
Nach-Nachfolger
}
}
\end{textblock*}
\end{frame}
\begin{frame}[label=gitintro10]
\frametitle{Einführung in git – Verwendung}
\begin{itemize}
\item Wir empfehlen: git Bedienung via Kommandozeile
%% NOTES:
% \begin{itemize}
% \item Alternative: Integration in die IDE
% \item Kommandozeile kann mehr
% \item[$\Rightarrow$] können hilft oft weiter
% \end{itemize}
\item Syntax: \texttt{git <command> [<args>]}
\item Beispiele:
\begin{itemize}
\item \texttt{git init}
\item \texttt{git add myscript.py}
\item \texttt{git commit -m "{}add basic functionality"}
\item \texttt{git push}\\[2mm]
\pause
\item \texttt{git status}
\item \texttt{git log}
\item \texttt{git branch develop}
\item \texttt{git checkout master}
\item \texttt{git merge develop}
\item \texttt{git blame myscript.py}
\item \texttt{git diff}
\item \texttt{git difftool}
\end{itemize}
\end{itemize}
\begin{textblock*}{\textwidth}[0.5,0.](120mm, 60mm)
\visible<3->{
\begin{itemize}
\item[] ~
\begin{itemize}
\item \texttt{git clone}
\item \texttt{git help <command>}
\item \texttt{git rebase} \\[2mm]
\item \texttt{git config}
\item \texttt{gitk}
\end{itemize}
\end{itemize}
}
\end{textblock*}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[label=gitintro20]
\frametitle{Praxis 1: Erste Schritte}
\begin{itemize}
\item Konfiguration anpassen
\begin{itemize}
\item \texttt{git config -{}-global user.email "foo@bar.de"}
\item \texttt{git config -{}-global user.name "Your Name"}
\item ...
\end{itemize}
\item Eigenes Repo \texttt{foo} erstellen
\begin{itemize}
\item \texttt{mkdir foo}
\item \texttt{cd foo}
\item \texttt{git init}
\end{itemize}
\item Alternativ: Bestehenedes Repo klonen
\begin{itemize}
\item \texttt{git clone <url>}
\end{itemize}
\item[]
\pause
\item Hintergrund: Wo speichert git\\ die relevanten Informationen?
\item[$\rightarrow$] Verstecktes Verzeichnis \texttt{.git}
\end{itemize}
\begin{textblock*}{40mm}[0.,0.](70mm,69mm)
\visible<2->{
\includegraphics[width=35mm]{img-src/git-dir1}
}
\end{textblock*}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Theorie: typischer Ablauf / "`staging area"' (1)}
\begin{center}
%% Gehirnvirus zuerst und allein auf einer Folie
%% Details mit schema auf einer späteren folie
\includegraphics[width=80mm]{img-src/git-staging-area}
\end{center}
\end{frame}
\begin{frame}[label=gitintro30]
\frametitle{Theorie: typischer Ablauf / "`staging area"' (2)}
\vspace{-8mm}
\begin{center}
\begin{tikzpicture}[
every text node part/.style={align=center},
node distance=3cm,
location/.style={
% The shape:
rectangle,
% The size:
minimum size=6mm,
% The border:
very thick,
draw=red!50!black!50,
% 50% red and 50% black,
% and that mixed with 50% white
% The filling:
top color=white,
% a shading that is white at the top...
bottom color=red!50!black!20, % and something else at the bottom
text height=4ex,
text depth=0.25ex,
}]
\node[location] (untracked) {working \\ tree};
\node[location] (staged) [right of=untracked] {index \\[-0.7em]};
\node[location] (committed) [right of=staged] {local \\ repository};
\node[location] (published) [right of=committed] {remote \\ repository};
\draw[->, thick, color=black!40!white] (untracked.east) -- (staged.west)
node [midway, above=2.5ex, color=black] {\texttt{git add}};
\draw[->, thick, color=black!40!white] (staged.east) -- (committed.west)
node [midway, above=2.5ex, color=black] {\texttt{git commit}};
\draw[->, thick, color=black!40!white] (committed.east) -- (published.west)
node [midway, above=2.5ex, color=black] {\texttt{git push}};
\end{tikzpicture}
\end{center}
Wozu zweiphasiger Commit-Prozess?
\begin{itemize}
\item Ermöglicht präzise, hoch aufgelöste Commits\\
\begin{itemize}
\item Änderungen mancher Dateien (\texttt{git add dir1/*.html})
\item Nur bestimmte Änderungen einer Datei (\texttt{git add -p})
\item Alle Änderungen übernehmen und comitten (\texttt{git commit -a})
\end{itemize}
\item[$\Rightarrow$] nachvollziehbare, aussagekräftige Commit-History
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile,label=gitintro40]
\frametitle{Praxis: minimales Repo}
\vspace{-5mm}
\begin{columns}
% Trick: durch Einfügen einer weiteren Spalte wird die 1. Spalte nach links gedrückt
\column[t]{1.0\textwidth}
\begin{itemize}
\item Inhalt erzeugen
\begin{itemize}
\item \verb|printf "Hallo\nWelt\n" > README.md|
\item \verb|git status|
\item \verb|git add README.md| \qquad \visible<1->{{\scriptsize Tipp: Auto-Vervollständigung mit TAB}}
\item \verb|git status|
\item \verb|git commit -m "New content of README"| %\quad \visible<4->{{\scriptsize Fehler absichtlich}}
\item \verb|git status|
\end{itemize}
\pause
\item Änderungen durchführen, anzeigen und committen
\begin{itemize}
\item \verb|sed -i -- "s/Welt/Leute/g" README.md|
\item \verb|git diff|
\pause
\pause
\item \verb|git commit -am "change Hello-message"|
\end{itemize}
\pause
\item Sich Überblick verschaffen
\begin{itemize}
\item \verb|git status|
\item \verb|git log|
\item \verb|gitk|
\end{itemize}
% \pause
% \item Letzten commit korrigieren (mit Editor, default: \texttt{\$EDITOR})
% \begin{itemize}
% \item \texttt{git config -{}-global core.editor mcedit}
% \item \texttt{git commit -{}-amend}
% \end{itemize}
\end{itemize}
\column[t]{0.1\textwidth}
~
\end{columns}
\begin{textblock*}{1cm}[0.,0.](95mm,53mm)
\visible<3->{
\includegraphics[height=15mm]{img-src/git-diff-snapshot}
}
\end{textblock*}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile,label=branches10]
\frametitle{Theorie: Branches}
\begin{columns}
\column{0.349\textwidth}
\only<1,2>{
\begin{tikzpicture}
\useasboundingbox (-1.5,-4.5) rectangle +(4,4.5);
% Commit DAG
\gitDAG[grow down sep = 1em]{
A -- B -- C
};
% Branch
\gitbranch
{master} % node name and text
{left=of C} % node placement
{C} % target
% HEAD reference
\gitHEAD
{above=of master} % node placement
{master} % target
\end{tikzpicture}
}
\only<3,5>{
\begin{tikzpicture}
\useasboundingbox (-1.5,-4.5) rectangle +(4,4.5);
% Commit DAG
\gitDAG[grow down sep = 1em]{
A -- B --{
C,
D -- E,
}
};
% Branch
\gitbranch
{master} % node name and text
{left=of C} % node placement
{C} % target
% HEAD reference
\gitHEAD
{above=of master} % node placement
{master} % target
\gitbranch
{bugfix} % node name and text
{left=of E} % node placement
{E}
\end{tikzpicture}
} % end of only
\only<4,6>{
\begin{tikzpicture}
\useasboundingbox (-1.5,-4.5) rectangle +(4,4.5);
% Commit DAG
\gitDAG[grow down sep = 1em]{
A -- B --{
C,
D -- E,
}
};
% Branch
\gitbranch
{master} % node name and text
{left=of C} % node placement
{C} % target
% HEAD reference
\gitHEAD
{below=of bugfix} % node placement
{bugfix} % target
\gitbranch
{bugfix} % node name and text
{left=of E} % node placement
{E}
\end{tikzpicture}
} % end of only
\only<7>{
\begin{tikzpicture}
\useasboundingbox (-1.5,-4.5) rectangle +(4,4.5);
% Commit DAG
\gitDAG[grow down sep = 1em]{
A -- B --{
C,
D -- E,
}
};
% Branch
\gitbranch
{master} % node name and text
{left=of C} % node placement
{C} % target
\gitbranch
{bugfix} % node name and text
{left=of E} % node placement
{E}
\gitHEAD
{above=of D, xshift=1.5em} % node placement
{D}
\end{tikzpicture}
} % end of only
\only<8>{
\begin{tikzpicture}
\useasboundingbox (-1.5,-4.5) rectangle +(4,4.5);
% Commit DAG
\gitDAG[grow down sep = 1em]{
A -- B --{
C,
D -- E,
}
};
% Branch
\gitbranch
{master} % node name and text
{left=of C} % node placement
{C} % target
\gitbranch
{bugfix} % node name and text
{left=of E} % node placement
{E}
\gitbranch
{experiment} % node name and text
{above=of D, xshift=1.5em} % node placement
{D}
% HEAD reference
\gitHEAD
{above=of experiment} % node placement
{experiment} % target
\end{tikzpicture}
} % end of only
\only<9>{
\begin{tikzpicture}
\useasboundingbox (-1.5,-4.5) rectangle +(4,4.5);
% Commit DAG
\gitDAG[grow down sep = 1em]{
A -- B --{
C,
D --{ E,
F -- G,
}
}
};
% Branch
\gitbranch
{master} % node name and text
{left=of C} % node placement
{C} % target
\gitbranch
{bugfix} % node name and text
{left=of E} % node placement
{E}
\gitbranch
{experiment} % node name and text
{left=of G} % node placement
{G}
% HEAD reference
\gitHEAD
{left=of experiment} % node placement
{experiment} % target
\end{tikzpicture}
} % end of only
\column{0.65\textwidth}
\begin{itemize}
\item Unkompliziertes paralleles Arbeiten an verschieden Versionen
\item<2-> Der aktive Branch folgt \texttt{HEAD}
\item<3-> beliebig viele Branches möglich
\item<4-> Branch/Revision wechseln:\\
% !! aus unklarem Grund funktioniert das hier nicht (\cverb oder \verb):
% \only<4,6>{\verb|git checkout bugfix|%}
% \only<5>{\verb|git checkout master|}
% \only<7->{\verb|git checkout <ref>|}
% deswegen nehmen wir jetzt \texttt (ohne Farbe)
\only<4,6>{\texttt{git checkout bugfix}}
\only<5>{\texttt{git checkout master}}
\only<7->{\texttt{git checkout <ref>}}
\item<8-> neuer Branch auf \texttt{HEAD} erstellen:\\
\verb|git checkout -b experiment|
\end{itemize}
\end{columns}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile,label=branches20]
\frametitle{Theorie: Zusammenfassung Branches}
\begin{columns}
\column{0.349\textwidth}
\begin{tikzpicture}
\useasboundingbox (-1.5,-4.5) rectangle +(4,4.5);
% Commit DAG
\gitDAG[grow down sep = 1em]{
A -- B --{
C,
D --{ E,
F -- G,
}
}
};
% Branch
\gitbranch
{master} % node name and text
{left=of C} % node placement
{C} % target
\gitbranch
{bugfix} % node name and text
{left=of E} % node placement
{E}
\gitbranch
{experiment} % node name and text
{left=of G} % node placement
{G}
% HEAD reference
\gitHEAD
{left=of experiment} % node placement
{experiment} % target
\end{tikzpicture}
\column{0.65\textwidth}
\begin{center}
\Large Branches sind \emph{lokale} Lesezeichen auf Knoten im
Revisionsgraphen. Beim Anlegen eines neuen Commits folgt der aktive
Branch dem neuen \texttt{HEAD}.
\end{center}
\end{columns}
\end{frame}
\begin{frame}[fragile,label=branches30]
\frametitle{Theorie: Mergen – Zusammenführen von Zweigen}
\begin{columns}
\column{0.39\textwidth}
\only<1>{
\begin{tikzpicture}
\useasboundingbox (-1.5,-4.5) rectangle +(4,4.5);
% Commit DAG
\gitDAG[grow down sep = 1em]{
A -- B -- C -- D -- E
};
\gitbranch
{master} % node name and text
{left=of B} % node placement
{B}
\gitbranch
{bugfix} % node name and text
{left=of E} % node placement
{E}
% HEAD reference
\gitHEAD
{below=of bugfix} % node placement
{bugfix}
\end{tikzpicture}
}%end of only
\only<2>{
\begin{tikzpicture}
\useasboundingbox (-1.5,-4.5) rectangle +(4,4.5);
% Commit DAG
\gitDAG[grow down sep = 1em]{
A -- B -- C -- D -- E
};
\gitbranch
{master} % node name and text
{left=of B} % node placement
{B}
\gitbranch
{bugfix} % node name and text
{left=of E} % node placement
{E}
% HEAD reference
\gitHEAD
{below=of master} % node placement
{master}
\end{tikzpicture}
}%end of only