From 166ab37d28f212317932a9b96ad094983ad5ea32 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Mon, 28 Mar 2011 09:50:49 +0200 Subject: [PATCH] Some minor additions to configuration and usage; example for remotes. --- main.tex | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 82 insertions(+), 9 deletions(-) diff --git a/main.tex b/main.tex index b4ada2c..1124daa 100644 --- a/main.tex +++ b/main.tex @@ -364,12 +364,14 @@ \begin{frameframe}{Arbeiten mit Git: Grundlagen} \begin{itemize} - \item $>>$ 100 einzelne Befehle + \item ca.\ 150 einzelne Befehle \item "`Porcelains"' und "`Plumbing"' - \item Dokumentation als Manpages - \texttt{git(7)} + \item Dokumentation als Manpages --- \texttt{git(7)} \item \texttt{git help}, \texttt{git $<$command$>$ -h} \item Benutzer Handbuch: \url{http://www.kernel.org/pub/software/scm/git/docs/user-manual.html} + \item "`Git Community Book"': \url{http://book.git-scm.com/} + \item Buch "`Pro Git"': \url{http://progit.org/book/} \end{itemize} \end{frameframe} @@ -429,8 +431,9 @@ \item $\rightarrow$ Benutzerinformationen für Commit-Metadaten \end{itemize} \end{block} +\end{frameframe} - \uncover<2>{ +\begin{frameframe}{Git konfigurieren} \begin{block}{Bunt und in Farbe} \begin{itemize} \item \texttt{git config --global color.ui auto} @@ -438,7 +441,17 @@ \texttt{status} Ausgaben \end{itemize} \end{block} + + \uncover<2>{ + \begin{block}{Weitere nützliche Optionen} + \begin{itemize} + \item {\ttfamily git config --global merge.tool vimdiff} + \item {\ttfamily git config --global push.default = current} + \item {\ttfamily git config --global alias.wdiff 'diff --color-words'} + \item … + \end{itemize} } + \end{block} \end{frameframe} \begin{frameframe}{Repositories erstellen} @@ -550,7 +563,7 @@ would print garbage (if you are lucky) or crash. This fixes it. {\ttfamily \footnotesize \$ git show\newline - \$ git show HEAD:foo + \$ git show HEAD:foo\hfill (siehe {\ttfamily gitrevisions(7)}) } \begin{itemize} @@ -583,7 +596,7 @@ would print garbage (if you are lucky) or crash. This fixes it. \item Branch: "`automatischer"' Zeiger auf eine Reihe von Commits \item \texttt{HEAD}: Zeiger auf den aktuellen Branch \item \texttt{master}: "`Standard"'-Branch - \item Merge: Zusammenführen von zwei Entwicklungssträngen + \item Merge: Zusammenführen von zwei (oder mehr) Entwicklungssträngen \end{itemize} \begin{block}{Branch erzeugen} @@ -596,7 +609,7 @@ would print garbage (if you are lucky) or crash. This fixes it. \uncover<2>{ \$ git branch\newline \hspace*{1em}master\newline - * new-branch + * $<$Name$>$ } \end{block} \end{frameframe} @@ -606,18 +619,18 @@ would print garbage (if you are lucky) or crash. This fixes it. \ttfamily \footnotesize \$ git merge master\newline - \$ git rebase master + \$ git rebase master \# nur in privaten Branches! \end{block} \uncover<2>{ \begin{block}{Konflikte auflösen} \begin{itemize} \item Konflikte entstehen, wenn die gleiche Stelle unterschiedlich - geändert wurde\newline - $\Rightarrow$ manuelles Eingreifen nötig + geändert wurde $\Rightarrow$ manuelles Eingreifen nötig \item Commit-Erzeugung wird unterbrochen \item Konfliktanzeiger in den betroffenen Dateien \item manuelle Entscheidung, wie beide Änderungen zusammengeführt werden + \item {\ttfamily git mergetool} \end{itemize} \end{block} } @@ -661,6 +674,7 @@ would print garbage (if you are lucky) or crash. This fixes it. \footnotesize \$ git remote add $<$Name$>$ URL\newline \$ git remote update $<$Name$>$ + \$ git push $<$Name$>$ \# ggf. zusätzlich Branch angeben \end{block} \end{frameframe} @@ -673,6 +687,65 @@ would print garbage (if you are lucky) or crash. This fixes it. \end{itemize} \end{frameframe} +\begin{frameframe}{Ein Beispiel …} + \begin{center} + \begin{tikzpicture}[x=1mm,y=1mm] + \node at (0,0) [circle,draw=red,fill=red!50,thick] (r) {}; + \node at (5,0) [anchor=west] {Upstream Repo}; + + \uncover<3->{ + \node at (-20,-30) [circle,draw=green,fill=green!50,thick] (i) {}; + \node at (-25,-30) [anchor=east] {interner Klon}; + } + \uncover<2->{ + \draw [->] (r.south west) -- (i.north east); + \node at (-12,-15) [anchor=east] {\ttfamily clone}; + } + + \uncover<5->{ + \node at (-25,-45) [circle,draw=black,fill=black!50,thick] (c1) {}; + \node at (-20,-45) {…}; + \node at (-15,-45) [circle,draw=black,fill=black!50,thick] (cn) {}; + \node at (-20,-50) {interne "`Clients"'}; + } + \uncover<4->{ + \draw [->] (i.south) -- (c1.north); + \node at (-20,-40) {\tiny …}; + \draw [->] (i.south) -- (cn.north); + } + + \uncover<7->{ + \node at (20,-30) [circle,draw=yellow,fill=yellow!50,thick] (qa) {}; + \node at (25,-30) [anchor=west] {QA Repo}; + } + \uncover<6->{ + \draw [->] (i.east) -- (qa.west); + \node at (0,-32) [anchor=north] {\ttfamily clone}; + } + + \uncover<8->{ + \draw [<->,dashed] (r.south east) -- (qa.north west); + \node at (12,-15) [anchor=west] {\ttfamily remote add up …}; + } + + \uncover<9>{ + \node at (-5,-20) + [anchor=north west,draw=black,fill=white,thick,rounded corners,% + inner sep=3mm] + {\begin{minipage}{55mm} + \ttfamily + \$ git fetch up\\ + \$ git checkout master\\ + \$ git merge up/master\\ + \$ git mergetool\\ + \$ git push \# origin master + \end{minipage} + }; + } + \end{tikzpicture} + \end{center} +\end{frameframe} + \begin{frameframe}{Frontends} \begin{itemize} \item \texttt{tig} (ncurses) -- 2.30.2