From 106a54a12b26b0b50f1e6f8ca104ce47c7a48faa Mon Sep 17 00:00:00 2001 From: Anders Nilsson <andersn@control.lth.se> Date: Wed, 20 Mar 2013 11:31:38 +0100 Subject: [PATCH] Before showing conflicts and merge --- git-tutorial.tex | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/git-tutorial.tex b/git-tutorial.tex index dfcd562..5bd6100 100644 --- a/git-tutorial.tex +++ b/git-tutorial.tex @@ -370,13 +370,46 @@ users; myself at home and myself at work. \subsubsection*{diff} \label{diff} +\verb|git diff| shows the differences between two revisions of a +file. When no revisions are given as arguments it lists the +differences to the latest committed revision. +\begin{lstlisting} +andersn@stodola: git diff git-tutorial.tex +diff --git a/git-tutorial.tex b/git-tutorial.tex +index dfcd562..3e66f5d 100644 +--- a/git-tutorial.tex ++++ b/git-tutorial.tex +@@ -370,7 +370,12 @@ users; myself at home and myself at work. + + \subsubsection*{diff} + \label{diff} ++\verb|git diff| shows the differences between two revisions of a ++file. When no revisions are given as arguments it lists the ++differences to the latest committed revision. + + \subsubsection*{merge} + \label{merge} +\end{lstlisting} +\subsubsection*{blame} +\label{blame} +If we are interested in finding out exactly who is responsible for +some information in a file, and when it was committed, we can use +\verb|git blame <file>|. In the example below we only show a small +excerpt of the output, the real output is a fully annotated version of +the file given as argument. +\begin{lstlisting}[ basicstyle=\tiny\ttfamily] +7c8a691e (Anders Nilsson 2013-03-20 11:07:17 +0100 370) +7c8a691e (Anders Nilsson 2013-03-20 11:07:17 +0100 371) \subsubsection*{diff} +7c8a691e (Anders Nilsson 2013-03-20 11:07:17 +0100 372) \label{diff} +00000000 (Not Committed Yet 2013-03-20 11:27:53 +0100 373) \verb|git diff| shows the diffe +00000000 (Not Committed Yet 2013-03-20 11:27:53 +0100 374) file. When no revisions are giv +00000000 (Not Committed Yet 2013-03-20 11:27:53 +0100 375) differences to the latest commi +\end{lstlisting} \subsubsection*{merge} \label{merge} -\subsubsection*{blame} -\label{blame} -- GitLab