Skip to content
Snippets Groups Projects
Commit 2af49b64 authored by Laros's avatar Laros
Browse files

Updated the basics slides.

parent df0d81df
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,7 @@
Initialized empty Git repository in <path>/.git/
\end{lstlisting}
\bigskip
\pause
Or you can ``clone'' an existing repository.
\bigskip
......@@ -120,6 +121,7 @@
# README
\end{lstlisting}
\bigskip
\pause
\begin{lstlisting}[language=none, caption=Now the file will be tracked.]
$ git add README
......@@ -146,8 +148,14 @@
This will open an editor, give a short description of the changes you made.
\begin{itemize}
\item This is useful when you want to search for older versions later.
\item Useful when you want to search.
\end{itemize}
\bigskip
\pause
\begin{lstlisting}[language=none, caption=Commit a new version.]
$ git commit -m "Solved the counting bug."
\end{lstlisting}
\end{frame}
\begin{frame}[fragile]
......@@ -164,6 +172,7 @@
# modified: README
\end{lstlisting}
\bigskip
\pause
If you want to undo this, you can use ``\bt{git reset}''.
\bigskip
......@@ -215,6 +224,11 @@
\bigskip
The hash can be found with ``\bt{git log}''.
\bigskip
\pause
You can also use an unique prefix of this hash, usually six characters is
enough.
\end{frame}
\begin{frame}[fragile]
......@@ -234,6 +248,15 @@
+Third version.
\end{lstlisting}
\bigskip
\pause
For staged files, use the ``\bt{--cached}'' or ``\bt{--staged}'' option.
\bigskip
\begin{lstlisting}[language=none, caption=Difference between the staging area
and the last commit.]
$ git diff --cached
\end{lstlisting}
\end{frame}
\begin{frame}[fragile]
......@@ -252,6 +275,12 @@
+Third version.
\end{lstlisting}
\bigskip
\pause
\begin{lstlisting}[language=none, caption=Difference between two committed
versions.]
$ git diff 8e10be cc61ee
\end{lstlisting}
\end{frame}
\section{Extras}
......@@ -261,12 +290,14 @@
Sometimes you do not want to track certain files:
\begin{itemize}
\item Executables.
\item \bt{pdf} files (if you still have the \LaTeX source).
\item \bt{pdf} files (if you still have the \LaTeX\ source).
\item Python bytecode (\bt{.pyc}) files.
\item Files containing passwords.
\end{itemize}
\bigskip
\pause
Use the special ``\bt{.gitignore}'' file.
\begin{lstlisting}[language=none, caption=Ignoring certain files.]
$ touch notrack.txt
$ echo notrack.txt > .gitignore
......@@ -277,6 +308,26 @@
\end{lstlisting}
\end{frame}
\begin{frame}[fragile]
\frametitle{Help.}
With the ``\bt{help}'' command get the manual of a particular subcommand.
\bigskip
\begin{lstlisting}[language=none, caption=Get the full manual.]
$ git help <command>
\end{lstlisting}
\bigskip
\pause
Example.
\bigskip
\begin{lstlisting}[language=none, caption=Get the manual for the diff
subcommand.]
$ git help diff
\end{lstlisting}
\end{frame}
\section{Questions?}
\lastpagetemplate
\begin{fframe}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment