Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Git course
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
courses
Git course
Commits
149fb8f2
Commit
149fb8f2
authored
10 years ago
by
bow
Browse files
Options
Downloads
Patches
Plain Diff
Update tips and tricks slide up to gitignore_global
parent
33e9cd8f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3
Updates bow
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tips/tips.tex
+88
-4
88 additions, 4 deletions
tips/tips.tex
with
88 additions
and
4 deletions
tips/tips.tex
+
88
−
4
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
}
...
...
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