Installation

Installation

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

To install git, run the following command on your preferred linux distribution:

sudo dnf install git
sudo apt install git

Configuration Structure

Git uses a series of configuration files to determine how configuration settings will be applied:

  • Stored in /etc/gitconfig.
  • Set values will apply to all users and all repositories on the Git server.
  • Can be written to using the following command: git config --system [key] [value]
  • Stored in ~/.gitconfig or ~/.config/git/config.
  • Applies to all repositories but only for the specific user who holds the configuration file.
  • Takes precedence over the System configuration file.
  • Stored in .git/config.
  • Set values affects all users of the repository the configuration file is within.
  • Takes precedence over the System and Global configuration file.

By default if no --system/global/local flag is given, --local is assumed.

Initial Configuration

ℹ️
To view the git servers current configuration run: git config -l.

Configure the following variables at a minimum. These variables are needed so other know who performed commits etc.

# Set your name.
git config --global user.name

# Sets your email address.
git config --global user.email