Установка на RHEL/CentOS:
# yum install git-core
Для Debian/Ubuntu:
# apt-get install git-core
GIT использует два файла настроек: /etc/gitconfig — общий, и ~/.gitconfig — для каждого пользователя.
Для настроек GIT используется команда config. При её вызове можно использовать параметр --system (для использования /etc/gitconfig), или --global (для файла ~/.gitconfig).
Допустимые опции и помощь можно получить вызвав утилиту без опций:
$ git config
usage: git config [options]
Config file location
--global use global config file
--system use system config file
-f, --file <FILE> use given config file
Action
--get get value: name [value-regex]
--get-all get all values: key [value-regex]
--get-regexp get values for regexp: name-regex [value-regex]
--replace-all replace all matching variables: name value [value_regex]
--add adds a new variable: name value
--unset removes a variable: name [value-regex]
--unset-all removes all matches: name [value-regex]
--rename-section rename section: old-name new-name
--remove-section remove a section: name
-l, --list list all
-e, --edit opens an editor
--get-color <slot> find the color configured: [default]
--get-colorbool <slot>
find the color setting: [stdout-is-tty]
Type
--bool value is "true" or "false"
--int value is decimal number
--bool-or-int value is --bool or --int
--path value is a path (file or directory name)
Other
-z, --null terminate values with NUL byte
Просмотреть текущие настройки:
$ git config -l http.proxy=http://127.0.0.1:3128
В данный момент, кроме прокси, ничего не настроено.
Добавим имя пользователя:
$ git config --global user.name "Username"
И почту:
$ git config --global user.email "[email protected]"
Редактор по умолчанию:
$ git config --global core.editor vim
И утилиту сравнения:
$ git config --global merge.tool vimdiff
Проверяем:
$ git config -l http.proxy=http://127.0.0.1:3128 user.name=Username [email protected] core.editor=vim merge.tool=vimdiff
Или, что бы проверить определённый параметр:
$ git config user.name Username
Что бы получить подсказку по использованию GIT:
$ git help
Или, по определённой команде:
$ git help config
Создание репозитория и добавление в него файлов рассмотрим в следующем посте.




