Infrastructure/Git/Configuration

From KDE Community Wiki

Git Configuration

How to set up Git for use in KDE.

Configuration Levels

Your Git configuration operates at 3 levels:

  • System
  • User
  • Repository

The System Level sets up global Git configuration defaults for every User and Repository on your system. We will ignore these for our purposes as they are usually blank.

The User Level (aka Global) sets up the default configuration for a particular User to apply to all repositories used by that User. Settings made at this level will always override any matching System Level settings. The User Configuration is stored in your ~/.gitconfig file.

The Repository Level sets up the configuration for a particular Repository clone. Settings made at this level will always override any matching User or System Level settings. The Repository Configuration is stored in the repository .git/config file.

The recommended KDE Git Configuration will set some settings at a user level and some at a repository level. You may wish to change the level some settings apply at however as we will assume you only or mostly use Git for developing KDE.

You can set Git settings either by directly editing the config files, or by using the git config command.

To set a Git setting at repo level (i.e in repo .git/config):

git config <key> <value>

To set a Git setting at User level (i.e. in ~/.gitconfig):

git config --global <key> <value>

URL Renaming

Instead of having to remember and type in the different full git addresses for pulling and pushing, we recommend you add the following to your Git User Configuration (~/.gitconfig):

[url "git://anongit.kde.org/"]
    insteadOf = kde:
[url "[email protected]:"]
    pushInsteadOf = kde:

RSA Key fingerprint for git.kde.org

c8:45:ba:89:85:11:78:b5:a4:09:d9:31:f6:7f:7c:79