19727a014STobin C. Harding.. _configuregit: 29727a014STobin C. Harding 39727a014STobin C. HardingConfigure Git 49727a014STobin C. Harding============= 59727a014STobin C. Harding 69727a014STobin C. HardingThis chapter describes maintainer level git configuration. 79727a014STobin C. Harding 89727a014STobin C. HardingTagged branches used in :ref:`Documentation/maintainer/pull-requests.rst 99727a014STobin C. Harding<pullrequests>` should be signed with the developers public GPG key. Signed 109727a014STobin C. Hardingtags can be created by passing the ``-u`` flag to ``git tag``. However, 119727a014STobin C. Hardingsince you would *usually* use the same key for the same project, you can 129727a014STobin C. Hardingset it once with 139727a014STobin C. Harding:: 149727a014STobin C. Harding 159727a014STobin C. Harding git config user.signingkey "keyname" 169727a014STobin C. Harding 179727a014STobin C. HardingAlternatively, edit your ``.git/config`` or ``~/.gitconfig`` file by hand: 189727a014STobin C. Harding:: 199727a014STobin C. Harding 209727a014STobin C. Harding [user] 219727a014STobin C. Harding name = Jane Developer 229727a014STobin C. Harding email = jd@domain.org 239727a014STobin C. Harding signingkey = jd@domain.org 249727a014STobin C. Harding 259727a014STobin C. HardingYou may need to tell ``git`` to use ``gpg2`` 269727a014STobin C. Harding:: 279727a014STobin C. Harding 289727a014STobin C. Harding [gpg] 299727a014STobin C. Harding program = /path/to/gpg2 309727a014STobin C. Harding 319727a014STobin C. HardingYou may also like to tell ``gpg`` which ``tty`` to use (add to your shell rc file) 329727a014STobin C. Harding:: 339727a014STobin C. Harding 349727a014STobin C. Harding export GPG_TTY=$(tty) 3529108490SLinus Walleij 3629108490SLinus Walleij 3729108490SLinus WalleijCreating commit links to lore.kernel.org 3829108490SLinus Walleij---------------------------------------- 3929108490SLinus Walleij 4029108490SLinus WalleijThe web site http://lore.kernel.org is meant as a grand archive of all mail 4129108490SLinus Walleijlist traffic concerning or influencing the kernel development. Storing archives 4229108490SLinus Walleijof patches here is a recommended practice, and when a maintainer applies a 4329108490SLinus Walleijpatch to a subsystem tree, it is a good idea to provide a Link: tag with a 4429108490SLinus Walleijreference back to the lore archive so that people that browse the commit 4529108490SLinus Walleijhistory can find related discussions and rationale behind a certain change. 4629108490SLinus WalleijThe link tag will look like this: 4729108490SLinus Walleij 4829108490SLinus Walleij Link: https://lore.kernel.org/r/<message-id> 4929108490SLinus Walleij 5029108490SLinus WalleijThis can be configured to happen automatically any time you issue ``git am`` 5129108490SLinus Walleijby adding the following hook into your git: 5229108490SLinus Walleij 5329108490SLinus Walleij.. code-block:: none 5429108490SLinus Walleij 5529108490SLinus Walleij $ git config am.messageid true 5629108490SLinus Walleij $ cat >.git/hooks/applypatch-msg <<'EOF' 5729108490SLinus Walleij #!/bin/sh 5829108490SLinus Walleij . git-sh-setup 59*2bb19e74SJohannes Berg perl -pi -e 's|^Message-I[dD]:\s*<?([^>]+)>?$|Link: https://lore.kernel.org/r/$1|g;' "$1" 6029108490SLinus Walleij test -x "$GIT_DIR/hooks/commit-msg" && 6129108490SLinus Walleij exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} 6229108490SLinus Walleij : 6329108490SLinus Walleij EOF 6429108490SLinus Walleij $ chmod a+x .git/hooks/applypatch-msg 65