Skip to content
Snippets Groups Projects
Commit 05b1c1bc authored by Laurent Modolo's avatar Laurent Modolo
Browse files

git add : blob creation

parent b572ee54
No related branches found
No related tags found
No related merge requests found
...@@ -104,6 +104,7 @@ time so that you can recall specific versions later. ...@@ -104,6 +104,7 @@ time so that you can recall specific versions later.
\frametitle{Creating a git repository} \frametitle{Creating a git repository}
Creating a project folder Creating a project folder
\vspace{-1em}
\begin{shcode} \begin{shcode}
~ $ mkdir alpha ~ $ mkdir alpha
~ $ cd alpha ~ $ cd alpha
...@@ -112,16 +113,19 @@ Creating a project folder ...@@ -112,16 +113,19 @@ Creating a project folder
~/alpha $ data/letter.txt ~/alpha $ data/letter.txt
\end{shcode} \end{shcode}
we have : we have :
\vspace{-1em}
\begin{shcode} \begin{shcode}
alpha alpha
└── data └── data
└── letter.txt └── letter.txt
\end{shcode} \end{shcode}
\vspace{-1em}
\end{frame} \end{frame}
\begin{frame}[fragile] \begin{frame}[fragile]
\frametitle{Creating a git repository} \frametitle{Creating a git repository}
Creating a git repository Creating a git repository
\vspace{-1em}
\begin{shcode} \begin{shcode}
~/alpha $ git init ~/alpha $ git init
Initialized empty Git repository in alpha/.git/ Initialized empty Git repository in alpha/.git/
...@@ -129,6 +133,7 @@ Initialized empty Git repository in alpha/.git/ ...@@ -129,6 +133,7 @@ Initialized empty Git repository in alpha/.git/
we have : we have :
\begin{columns} \begin{columns}
\begin{column}{0.6\textwidth} \begin{column}{0.6\textwidth}
\vspace{-1em}
\begin{shcode} \begin{shcode}
alpha alpha
├── data ├── data
...@@ -137,16 +142,63 @@ alpha ...@@ -137,16 +142,63 @@ alpha
├── objects ├── objects
etc... etc...
\end{shcode} \end{shcode}
\vspace{-1em}
\end{column} \end{column}
\begin{column}{0.4\textwidth} \begin{column}{0.4\textwidth}
\includegraphics[width=0.9\textwidth]{./img/vcs_local.png} \includegraphics[width=0.9\textwidth]{./img/vcs_local.png}
\end{column} \end{column}
\end{columns} \end{columns}
The \texttt{.git} directory and its contents are Git’s. The \mintinline{sh}{.git} directory and its contents are Git’s.
All the other files are collectively known as the \textbf{working copy}. All the other files are collectively known as the \textbf{working copy}.
They are the user’s. They are the user’s.
\end{frame}
\begin{frame}[fragile]
\frametitle{tracking a file with git}
We want to track the modification made to \mintinline{sh}{letter.txt}
\vspace{-1em}
\begin{shcode}
~/alpha $ git add data/letter.txt
\end{shcode}
git create a new blob file in the \mintinline{sh}{.git/objects/} directory.
\vspace{-1em}
\begin{shcode}
alpha
├── data
│ └── letter.txt
└── .git
├── objects
│ ├── 78
│ │ └── 981922613b2afb6025042ff6bd878ac1994e85
etc...
\end{shcode}
\vspace{-1em}
\end{frame}
\begin{frame}[fragile]
\frametitle{tracking a file with git}
We want to track the modification made to \mintinline{sh}{letter.txt}\\[-2em]
\begin{shcode}
~/alpha $ git add data/letter.txt
\end{shcode}
\vspace{-2.5em}
git create a new \textbf{blob} file in the \mintinline{sh}{.git/objects/} directory\\[-2em]
\begin{shcode}
├── objects
│ ├── 78
│ │ └── 981922613b2afb6025042ff6bd878ac1994e85
\end{shcode}
\vspace{-2.5em}
Git \textbf{blob}:\\[-2.5em]
\begin{itemize}
\item contains the compressed content of a file
\item The name of the blob is the SHA1 of the file.
\item The first two characters of the SHA1 are used as the name of a directory inside the objects folder
\item The rest of the hash is used as the name of the blob file
\end{itemize}
\end{frame} \end{frame}
\end{document} \end{document}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment