Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Git course
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
courses
Git course
Commits
2af49b64
Commit
2af49b64
authored
Oct 14, 2013
by
Laros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated the basics slides.
parent
df0d81df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
2 deletions
+53
-2
basics/basics.tex
basics/basics.tex
+53
-2
No files found.
basics/basics.tex
View file @
2af49b64
...
...
@@ -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
8
e
10
be cc
61
ee
\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}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment