Difference between revisions of "Development/Git/Configuration"

Jump to: navigation, search
(Configuration Levels)
Line 37: Line 37:
     pushInsteadOf = kde:
     pushInsteadOf = kde:
=== RSA Key fingerprint for git.kde.org===
== RSA Key fingerprint for git.kde.org==

Revision as of 09:44, 18 March 2011

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 "git@git.kde.org:"]
    pushInsteadOf = kde:

RSA Key fingerprint for git.kde.org


Content is available under Creative Commons License SA 4.0 unless otherwise noted.