Commit 1342d8b6 authored by Mihai's avatar Mihai

Extended basics practical + extraas

parent 0f3fd2ab
......@@ -111,7 +111,7 @@
\end{pframe}
\section{Git Operations}
\subsection{Checking the status of your files}
\subsection{Checking repository state}
\begin{pframe}
\begin{framed}
\prompt\ \gitcmd\ \cmd{status}\\
......@@ -119,17 +119,6 @@
\end{framed}
\end{pframe}
\begin{pframe}
Git itself will associate your files with various \textbf{states}
\footnote[1]{\scriptsize{Adapted from the
\href{http://git-scm.com/book/en/v2/Getting-Started-Git-Basics}
{Pro Git Book}.}}:
\begin{center}
\includegraphics[width=0.85\textwidth]{images/file_status_cycles.pdf}\\
\end{center}
\end{pframe}
\subsection{Checking the status of your files}
\begin{pframe}
\begin{framed}
\prompt\ \cmd{echo}\ \cmdarg{"First version."}\ \op{$>$}\ \cmdarg{README}
......@@ -151,6 +140,16 @@
\end{framed}
\end{pframe}
\subsection{Git file states}
\begin{pframe}
Git itself will associate your files with various \textbf{states}
\footnote[1]{\scriptsize{Adapted from the
\href{http://git-scm.com/book/en/v2/Getting-Started-Git-Basics}
{Pro Git Book}.}}:
\begin{center}
\includegraphics[width=0.85\textwidth]{images/file_status_cycles.pdf}\\
\end{center}
\end{pframe}
\subsection{Adding/staging files}
\begin{pframe}
......
......@@ -4,9 +4,16 @@
\providecommand{\handoutsTitle}{Git Basics}
\usepackage{multicol}
\usepackage{enumitem}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{handouts}
\input{../shared/shared}
\begin{document}
\makeHeader
......@@ -33,6 +40,76 @@ Introduce your provided \textbf{username} and press enter.
Introduce your provided \textbf{password} and press enter.
\medskip
\section{General questions}
\begin{enumerate}
\item How can you check your local git repository state?
\vspace{-0.2cm}
\begin{multicols}{3}
\begin{enumerate}[label=(\alph*)]
\item git state
\item git repository
\item git commit
\item git status
\item git show
\item git log
\end{enumerate}
\end{multicols}
\vspace{-0.3cm}
\item What command is used to stage a file?
\vspace{-0.2cm}
\begin{multicols}{3}
\begin{enumerate}[label=(\alph*)]
\item git stage
\item git checkout
\item git add
\item git status
\item git diff
\item git log
\end{enumerate}
\end{multicols}
\vspace{-0.3cm}
\item How do you tell git what files to ignore?
\vspace{-0.2cm}
\begin{multicols}{2}
\begin{enumerate}[label=(\alph*)]
\item git ignore \{file-name\}
\item add the file paths to a file named ``.gitignore''
\item it is not possible
\item git not track \{file-name\}
\end{enumerate}
\end{multicols}
\vspace{-0.3cm}
\item The \gitcmd\ \cmd{commit}\ command:
\vspace{-0.2cm}
\begin{multicols}{2}
\begin{enumerate}[label=(\alph*)]
\item stages all the modified files
\item saves the staged files changes into the repository ``database''
\item retrieves old files into the working directory
\item shows a repository history and lets the user pick what commits to
discard
\end{enumerate}
\end{multicols}
\vspace{-0.3cm}
\item A file is brought into the modified state when:
\vspace{-0.2cm}
\begin{multicols}{2}
\begin{enumerate}
\item[[ ]] it is being staged
\item[[ ]] it is being edited by the user
\item[[ ]] the user checks out a previous version of it
\item[[ ]] the file is committed
\end{enumerate}
\end{multicols}
\vspace{-0.3cm}
\end{enumerate}
\section{Practical exercises}
\subsubsection*{Local configuration}
First, let Git know what your name and e-mail address is:
\begin{lstlisting}
......
......@@ -3,32 +3,19 @@
\providecommand{\handoutsTitle}{\vspace{0.5cm}The git commit graph}
\usepackage{handouts}
\input{../shared/shared}
\usepackage{multicol}
\usepackage{enumitem}
\usepackage{xcolor}
\usepackage{graphicx}
\input{../shared/shared}
\begin{document}
\makeHeader
\section{General questions}
\begin{enumerate}
\item How do you check your local git repository state since your last commit?
\vspace{-0.2cm}
\begin{multicols}{3}
\begin{enumerate}[label=(\alph*)]
\item git state
\item git repository
\item git commit
\item git status
\item git show
\item git log
\end{enumerate}
\end{multicols}
\vspace{-0.3cm}
\item A branch is:
\vspace{-0.2cm}
\begin{multicols}{3}
......@@ -43,6 +30,20 @@
\end{multicols}
\vspace{-0.3cm}
\item How can you see the commit history in a tree alike manner?
\vspace{-0.2cm}
\begin{multicols}{3}
\begin{enumerate}[label=(\alph*)]
\item git state
\item git repository
\item git commit
\item git status --tree
\item git show tree
\item git log --graph
\end{enumerate}
\end{multicols}
\vspace{-0.3cm}
\item What command could be used in joining two or more development histories (branches) together?
\vspace{-0.2cm}
\begin{multicols}{3}
......
......@@ -3,6 +3,12 @@
\providecommand{\handoutsTitle}{Git and remote repositories}
\usepackage{handouts}
\usepackage{multicol}
\usepackage{enumitem}
\usepackage{xcolor}
\usepackage{graphicx}
\input{../shared/shared}
\begin{document}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment