# 02. Git Config

Конфигурационные параметры гита могут быть заданы для нескольких разных уровней:

1. System: `etc/config` - системные настройки (`--system`);
2. Global: `~/.gitconfig` - настройки конкретного пользователя (`--global`);
3. Local: `.git/config` - настройки конкретного репозитория (`--local`).

Для каждого конкретного репозитория git системные, глобальные и локальные параметры.

Вызов команды `git config key value` по умолчанию затронет локальные настройки.

```bash
git config --list # list config values
git config <key> # read config key

git config --system key value # read/write system git config
git config --global key value # read/write global git config
git config --local  key value # read/write local git config
```

### Initial config

```bash
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
```

### `gitignore` config

* Создайте `~/.gitignore` - глобальный gitignore-файл
* В `~/.gitconfig` укажите `core.excludesfile=~/.gitignore`

### Git configuration

Конфигурационные параметры гита делятся на две категории: *клиентские* (задают предпочтения пользователя) и *серверные* (описывают настройки удаленного сервера).

```bash
core.editor emacs # setup editor
commit.template # path to commit template
core.pager # setup paging in result (more|less|<empty>)
core.excludesfile filepath #
```

* [`git config` by Bitbucket](https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config)
