User Tools

Site Tools


This is an old revision of the document!

Set up git

Setting up git is pretty straight-forward. Git configuration can be done per repository -local configuration-, per user -global configuration- and per host -system configuration-. Local configuration is stored in the repository at .git/config, global configuration at ~/.gitconfig and system configuration at /etc/gitconfig (depends on your distro). In the examples below we'll assume you are setting up git for your user, so we'll set up the global configuration.

Your identity

Let's begin by telling git your name and e-mail address. This will be used on commit logs and when sending e-mails through git send-email.

$ git config --global "John Doe"
$ git config --global

Optionally you may also add your PGP key fingerprint, this is useful if you maintain your own tree and want to guarantee its integrity. For more information on this, check out the kernel maintainer's pgp guide

$ git config --global user.signingKey <key fingerprint / key id>

Your mail settings

These settings are used for sending patches and patchsets through git send-email.

Directly use SMTP server

Note that you may also store your password here but it's not a good idea since it will be stored in plaintext. So leave it unset and git send-email will ask you for it.

$ git config --global sendemail.smtpencryption tls
$ git config --global sendemail.smtpserver
$ git config --global sendemail.smtpuser
$ git config --global sendemail.smtpserverport 587


Your preferences

Git allows you to use your favourite tools, in this example we'll use more for pager, nano for editor and meld for diff/merge. In order to use meld instead of the pager for displaying d

$ git config --global core.pager "more"

$ git config --global core.editor "nano -w"

$ git config --global diff.tool meld
$ git config --global difftool.prompt false

$ git config --global merge.tool meld
$ git config --global mergetool.prompt false
developers/env_prepare.1539965565.txt.gz · Last modified: 2018/10/19 19:12 by mick