Pages

Sunday, March 3, 2019

Git Configuration

While working with code and pushing changes to repository, metadata regarding the changes done, who did the changes are necessary. Some of these configuration details are set by git itself. “Git config” command lets you to configure the git.

There are 3 types of these configurations available in git

System-wide Configuration - A system wide git configuration is not very common. Most of the times, the git is configured for a user or a local repository. A system wide configuration can be done by using the same “git config” by passing the “--system” option as “git config --system”

The configuration is saved in the /etc/gitconfig file.

User level Configuration - This is the most basic type of configuration. Information like committer or author of a code change can be set using this type of configuration. The configuration can be set using “git config --global” command. The settings are saved in the .gitconfig file in the user home directory.

Repository level Configuration - This configuration is specific to the repository. The setting are set using the “git config --system” command and these settings are saved in the location .git/config file.

Basic level Configuration

Color highlighting                : git config --global color.ui auto
Default Editor for git            : git config --global core.editor vim
User name                          : git config --global user.name "Firstname Lastname"
Email ID                             : git config --global user.email "your.email@example.org"

No comments :

Post a Comment