Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
git_basis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LBMC
Hub
formations
git_basis
Commits
05b1c1bc
Commit
05b1c1bc
authored
7 years ago
by
Laurent Modolo
Browse files
Options
Downloads
Patches
Plain Diff
git add : blob creation
parent
b572ee54
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
presentation.tex
+53
-1
53 additions, 1 deletion
presentation.tex
with
53 additions
and
1 deletion
presentation.tex
+
53
−
1
View file @
05b1c1bc
...
@@ -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
{
-
1
em
}
\begin
{
shcode
}
\begin
{
shcode
}
alpha
alpha
└── data
└── data
└── letter.txt
└── letter.txt
\end
{
shcode
}
\end
{
shcode
}
\vspace
{
-
1
em
}
\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
{
-
1
em
}
\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
{
-
1
em
}
\begin
{
shcode
}
alpha
├── data
│ └── letter.txt
└── .git
├── objects
│ ├──
78
│ │ └──
981922613
b
2
afb
6025042
ff
6
bd
878
ac
1994
e
85
etc...
\end
{
shcode
}
\vspace
{
-
1
em
}
\end
{
frame
}
\begin
{
frame
}
[
fragile
]
\frametitle
{
tracking a file with git
}
We want to track the modification made to
\mintinline
{
sh
}{
letter.txt
}
\\
[-
2
em
]
\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}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment