18c2ecf20Sopenharmony_ci.. _configuregit: 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ciConfigure Git 48c2ecf20Sopenharmony_ci============= 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ciThis chapter describes maintainer level git configuration. 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ciTagged branches used in :ref:`Documentation/maintainer/pull-requests.rst 98c2ecf20Sopenharmony_ci<pullrequests>` should be signed with the developers public GPG key. Signed 108c2ecf20Sopenharmony_citags can be created by passing the ``-u`` flag to ``git tag``. However, 118c2ecf20Sopenharmony_cisince you would *usually* use the same key for the same project, you can 128c2ecf20Sopenharmony_ciset it once with 138c2ecf20Sopenharmony_ci:: 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci git config user.signingkey "keyname" 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ciAlternatively, edit your ``.git/config`` or ``~/.gitconfig`` file by hand: 188c2ecf20Sopenharmony_ci:: 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci [user] 218c2ecf20Sopenharmony_ci name = Jane Developer 228c2ecf20Sopenharmony_ci email = jd@domain.org 238c2ecf20Sopenharmony_ci signingkey = jd@domain.org 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ciYou may need to tell ``git`` to use ``gpg2`` 268c2ecf20Sopenharmony_ci:: 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci [gpg] 298c2ecf20Sopenharmony_ci program = /path/to/gpg2 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ciYou may also like to tell ``gpg`` which ``tty`` to use (add to your shell rc file) 328c2ecf20Sopenharmony_ci:: 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci export GPG_TTY=$(tty) 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ciCreating commit links to lore.kernel.org 388c2ecf20Sopenharmony_ci---------------------------------------- 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ciThe web site http://lore.kernel.org is meant as a grand archive of all mail 418c2ecf20Sopenharmony_cilist traffic concerning or influencing the kernel development. Storing archives 428c2ecf20Sopenharmony_ciof patches here is a recommended practice, and when a maintainer applies a 438c2ecf20Sopenharmony_cipatch to a subsystem tree, it is a good idea to provide a Link: tag with a 448c2ecf20Sopenharmony_cireference back to the lore archive so that people that browse the commit 458c2ecf20Sopenharmony_cihistory can find related discussions and rationale behind a certain change. 468c2ecf20Sopenharmony_ciThe link tag will look like this: 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci Link: https://lore.kernel.org/r/<message-id> 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ciThis can be configured to happen automatically any time you issue ``git am`` 518c2ecf20Sopenharmony_ciby adding the following hook into your git: 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci.. code-block:: none 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci $ git config am.messageid true 568c2ecf20Sopenharmony_ci $ cat >.git/hooks/applypatch-msg <<'EOF' 578c2ecf20Sopenharmony_ci #!/bin/sh 588c2ecf20Sopenharmony_ci . git-sh-setup 598c2ecf20Sopenharmony_ci perl -pi -e 's|^Message-Id:\s*<?([^>]+)>?$|Link: https://lore.kernel.org/r/$1|g;' "$1" 608c2ecf20Sopenharmony_ci test -x "$GIT_DIR/hooks/commit-msg" && 618c2ecf20Sopenharmony_ci exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} 628c2ecf20Sopenharmony_ci : 638c2ecf20Sopenharmony_ci EOF 648c2ecf20Sopenharmony_ci $ chmod a+x .git/hooks/applypatch-msg 65