Next: , Previous: , Up: Top   [Contents][Index]

3 Configuring Global Settings For Git

Before starting to use Git, you should configure it with some important settings that won’t change as you use Git. You may configure options both globally, and on a per-repository basis. Here, we discuss only global configuration settings.

You can configure Git using either ‘git config’, or by editing the relevant files with your favorite text editor.4

The first things to set are your email address and your real name:

$ git config --global "J.P. Developer"     Set full name
$ git config --global   Set email address

Setting these two items are an absolute requirement. Note: No aliases are allowed. If you can’t supply your real name, you cannot contribute to the project. Other options that the gawk maintainer recommends that you use are:

$ git config --global push.default simple    Only push current branch
$ git config --global pager.status true      Use pager for output of git status

The global settings are stored in the .gitconfig file in your home directory. The file looks like this:

        name = J.P. Developer
        email =
        default = simple
        status = true

The push.default=simple setting ensures that older versions of Git only push the current branch up to the Savannah repo. This is the safest way to operate, and is the default in current Git versions.

There may be other settings in your configuration file as well. Use ‘git config’ to see your settings:

$ git config --list
-| Developer
-| push.default=simple

Here are the gawk maintainer’s settings:

$ git config --global --list
-| D. Robbins
-| credential.helper=cache --timeout=3600
-| push.default=simple
-| color.ui=false
-| core.autocrlf=input
-| pager.status=true
-| log.decorate=auto

Additional, per-project (“local”) settings are stored in each repo’s .git/config file.



You are required to use either Vim or Emacs, other text editors are not allowed. Of course, reasonable developers wouldn’t want to use any other editor anyway.

Next: , Previous: , Up: Top   [Contents][Index]