diff --git a/git-tutorial.tex b/git-tutorial.tex index dfcd56249d1521b298223fdb8be90ae93a0b2ccc..5bd6100010633b4f3be4baf8ad6bc904756552cc 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}