09
Configuration
&
Environment
Tuning
Git
'
s
behaviour
and
identity
to
the
machine
,
the
directory
,
and
the
project
.
Configuration
scopes
git config
-
-list
-
-show-origin
Understand
system
,
global
,
local
,
and
worktree
config
precedence
,
and
trace
any
effective
setting
back
to
the
file
that
defines
it
.
Conditional
includes
includeIf "gitdir:
~
/work/"
Switch
identity
,
email
,
signing
key
,
and
hooks
automatically
based
on
directory
,
keeping
work
and
personal
configurations
cleanly
separated
.
Aliases
git config
-
-global alias.lg "log
-
-oneline
-
-graph"
Encode
frequently
used
multi
-
flag
commands
and
shell
pipelines
as
short
,
shared
aliases
that
survive
across
machines
and
dotfile
setups
.
Core
behaviour
settings
git config
-
-global core.autocrlf input
Set
default
branch
,
line
-
ending
handling
,
rebase
and
prune
defaults
,
rerere
,
and
diff
algorithms
deliberately
rather
than
inheriting
defaults
.
Credential
management
git config
-
-global credential.helper osxkeychain
Use
OS
keychains
and
scoped
personal
access
tokens
or
SSH
keys
instead
of
stored
plaintext
credentials
,
including
per
-
host
credential
rules
.
Signing
setup
git config
-
-global commit.gpgsign true
Register
GPG
or
SSH
signing
keys
,
enforce
signing
by
default
,
and
verify
signed
commits
and
tags
both
locally
and
in
CI
.
9 / 11