0001 .. _configuregit:
0002
0003 Configure Git
0004 =============
0005
0006 This chapter describes maintainer level git configuration.
0007
0008 Tagged branches used in :ref:`Documentation/maintainer/pull-requests.rst
0009 <pullrequests>` should be signed with the developers public GPG key. Signed
0010 tags can be created by passing the ``-u`` flag to ``git tag``. However,
0011 since you would *usually* use the same key for the same project, you can
0012 set it once with
0013 ::
0014
0015 git config user.signingkey "keyname"
0016
0017 Alternatively, edit your ``.git/config`` or ``~/.gitconfig`` file by hand:
0018 ::
0019
0020 [user]
0021 name = Jane Developer
0022 email = jd@domain.org
0023 signingkey = jd@domain.org
0024
0025 You may need to tell ``git`` to use ``gpg2``
0026 ::
0027
0028 [gpg]
0029 program = /path/to/gpg2
0030
0031 You may also like to tell ``gpg`` which ``tty`` to use (add to your shell rc file)
0032 ::
0033
0034 export GPG_TTY=$(tty)
0035
0036
0037 Creating commit links to lore.kernel.org
0038 ----------------------------------------
0039
0040 The web site http://lore.kernel.org is meant as a grand archive of all mail
0041 list traffic concerning or influencing the kernel development. Storing archives
0042 of patches here is a recommended practice, and when a maintainer applies a
0043 patch to a subsystem tree, it is a good idea to provide a Link: tag with a
0044 reference back to the lore archive so that people that browse the commit
0045 history can find related discussions and rationale behind a certain change.
0046 The link tag will look like this:
0047
0048 Link: https://lore.kernel.org/r/<message-id>
0049
0050 This can be configured to happen automatically any time you issue ``git am``
0051 by adding the following hook into your git:
0052
0053 .. code-block:: none
0054
0055 $ git config am.messageid true
0056 $ cat >.git/hooks/applypatch-msg <<'EOF'
0057 #!/bin/sh
0058 . git-sh-setup
0059 perl -pi -e 's|^Message-Id:\s*<?([^>]+)>?$|Link: https://lore.kernel.org/r/$1|g;' "$1"
0060 test -x "$GIT_DIR/hooks/commit-msg" &&
0061 exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"}
0062 :
0063 EOF
0064 $ chmod a+x .git/hooks/applypatch-msg