Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
courses
Git course
Commits
149fb8f2
Commit
149fb8f2
authored
Jun 20, 2014
by
bow
Browse files
Update tips and tricks slide up to gitignore_global
parent
33e9cd8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
tips/tips.tex
View file @
149fb8f2
...
...
@@ -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
}
...
...
Write
Preview
Supports
Markdown
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