diff --git a/tips/tips.tex b/tips/tips.tex index 3b24ab11dd8c484c5847dac12d0e52ca02e9d36e..e10ee0bd427ccb87741917eee004c9f6137d3cee 100644 --- a/tips/tips.tex +++ b/tips/tips.tex @@ -34,14 +34,98 @@ \begin{frame}[fragile] \frametitle{} - % + We have only been playing with some of what git offers. In reality, + you can do much more with it. It also allows for a wide array of + customizations. \bigskip - - \begin{lstlisting}[language=none, caption=] - $ + + We will look into some of these customizations now. +\end{frame} + + +\section{Main Configuration File} +\begin{frame}[fragile] + \frametitle{Viewing} + + In Linux, git uses the ``\bt{~/.gitconfig}'' file as its main + configuration file. + \bigskip + \pause + + To see the current configuration values, use ``\bt{git config --list}''. + \begin{lstlisting}[language=none, caption=Git config values] + $ git config --list + user.name=bow + user.email=bow@bow.web.id + color.ui=auto + \end{lstlisting} + \bigskip +\end{frame} + + +\section{Main Configuration File} +\begin{frame}[fragile] + \frametitle{Modifying} + + To edit the file directly, open ``\bt{~/.gitconfig}'' in a text editor + and save your changes. + \begin{lstlisting}[language=none, caption=Modifying the config file] + $ vim ~/.gitconfig \end{lstlisting} \bigskip \pause + + You can also use the ``\bt{git config}'' to set the values via the shell. + \begin{lstlisting}[language=none, caption=Modifying via the shell] + $ git config user.name "Linus Torvalds" + \end{lstlisting} + \bigskip +\end{frame} + +\section{Main Configuration File} +\begin{frame}[fragile] + \frametitle{Modifying: global ignore} + + We will look at two examples now: setting a global ignore file and + setting aliases. + \bigskip + \pause + + In addition to setting a directory-specific ``\bt{.gitignore}'' file, + you can also set a global ignore file. + \bigskip + \pause + + You can name this file anything. The convention is to use + ``\bt{.gitignore\_global}'' and place the file in your home directory. + \bigskip +\end{frame} + + +\section{Main Configuration File} +\begin{frame}[fragile] + \frametitle{} + + The global ignore file has the same format as the per-directory + ``\bt{.gitignore}'' file, only visible to all git repositories. + \bigskip + \pause + + \begin{lstlisting}[language=none, caption=Setting the global ignore file] + $ echo "*.out" > ~/.gitignore_global + $ echo "testing.txt" > ~/.gitignore_global + $ git config core.excludesfile "~/.gitignore_global" + \end{lstlisting} + \bigskip + \pause + + \begin{lstlisting}[language=none, caption=Ignoring via the global file] + $ echo "Is this the real life?" > this.out + $ touch testing.txt + $ git status + nothing to commit, working directory clean + \end{lstlisting} + \bigskip \end{frame}