You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: basicbasics.tex
+21-7Lines changed: 21 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,16 @@ \section{The basic basics}
70
70
\end{block}
71
71
72
72
\begin{block}{Commit}
73
-
A basic unit of work in a project. Contains the set of changes, a textual description of what these changes do, a reference to the previous state (the \textit{parent commit}), and the author name and date.\\\smallskip Finally, the commit contains an alphanumeric identifier (SHA-1 hash), generated from the above information, which is used to uniquely identify the commit. \\For example: \textcolor{Maroon}{\texttt{bdfa760c07d8f621ff603a2dc5d6de810cd62e88}}
73
+
A basic unit of work in a project. Contains a \textbf{snapshot} of the complete project, a reference to a previous snapshot (the \textit{parent commit}), the commit message -- a textual description of the changes in the commit (with respect to the parent commit), the commit author name, and the commit date.
74
+
\end{block}
75
+
\end{frame}
76
+
77
+
\begin{frame}
78
+
79
+
\frametitle{Commit ID (SHA)}
80
+
\begin{block}{Commit ID}
81
+
82
+
\smallskip Every commit is marked with an alphanumeric identifier (SHA-1 hash) generated from the above information, which is used to uniquely identify the commit. \\For example: \textcolor{Maroon}{\texttt{bdfa760c07d8f621ff603a2dc5d6de810cd62e88}}
74
83
\smallskip
75
84
76
85
You can also use a prefix of the identifier to refer to this commit, usually 5 or 7 characters long, e.g. \textcolor{Maroon}{\texttt{bdfa760}}.
@@ -84,11 +93,13 @@ \section{The basic basics}
84
93
\frametitle{Basic terms: branch, master and head}
85
94
86
95
\begin{block}{Branch, master and head}
87
-
A \alert{branch} is simply a pointer to a commit. \alert{Master} is the name of the default branch. \alert{Head} is a pointer to the last commit in the currently active (checked out) branch.
96
+
A \alert{branch} is simply a pointer to a commit. \alert{Master} is usually the name of the main branch (but does not have to be). \alert{HEAD} is a special pointer to the currently checked out commit. \\
97
+
\smallskip
98
+
The commits with their parent-child relationships form a directed acyclic graph (DAG).
88
99
\end{block}
89
100
90
101
\begin{figure}
91
-
\includegraphics[scale=0.3]{branches}
102
+
\includegraphics[scale=0.26]{branches}
92
103
\end{figure}
93
104
94
105
\end{frame}
@@ -148,14 +159,17 @@ \section{The basic basics}
148
159
\begin{block}{Cloning}
149
160
Cloning creates a local copy of the repository, which includes all the commits in the repository -- the whole history.
\item NB -- if you committed something, it is in your local repo, (almost) permanently. Do not make it a habit to delete your local repositories -- if you "lose" a commit, it can be recovered (by its ID), even if you have deleted the branch!
172
+
\end{itemize}
159
173
160
174
\end{frame}
161
175
@@ -175,7 +189,7 @@ \section{The basic basics}
175
189
176
190
\begin{itemize}
177
191
\item The \textit{working tree} -- current version of files ("checked out")
178
-
\item The hidden \texttt{.git} folder which contains repository metadata \\ (all the commits, and the internal structures for storing them)
192
+
\item The hidden \texttt{.git} folder which contains repository metadata \\ (all the commits)
179
193
\item The \texttt{git status} command provides an overview of what is going on in the git repository.
180
194
\end{itemize}
181
195
\begin{minted}{console}
@@ -339,12 +353,12 @@ \section{The basic basics}
339
353
> git reset --hard
340
354
\end{minted}
341
355
342
-
\item This will restore all tracked files in the working tree to the most recently committed version (this commit is also known as the \texttt{HEAD} commit).
356
+
\item This will restore all tracked files in the working tree to the most recently committed version (i.e. the \texttt{HEAD} commit).
343
357
\end{itemize}
344
358
345
359
\begin{block}{Task I [Mirko, Slavko]: Discarding several unwanted changes}
346
360
\begin{itemize}
347
-
\item Delete several files from the cloned example repository. Do not add or commit the changes.
361
+
\item Delete several files from the cloned example repository. Do not commit the changes.
0 commit comments