configure-git.rst 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. .. _configuregit:
  2. Configure Git
  3. =============
  4. This chapter describes maintainer level git configuration.
  5. Tagged branches used in :ref:`Documentation/maintainer/pull-requests.rst
  6. <pullrequests>` should be signed with the developers public GPG key. Signed
  7. tags can be created by passing the ``-u`` flag to ``git tag``. However,
  8. since you would *usually* use the same key for the same project, you can
  9. set it once with
  10. ::
  11. git config user.signingkey "keyname"
  12. Alternatively, edit your ``.git/config`` or ``~/.gitconfig`` file by hand:
  13. ::
  14. [user]
  15. name = Jane Developer
  16. email = jd@domain.org
  17. signingkey = jd@domain.org
  18. You may need to tell ``git`` to use ``gpg2``
  19. ::
  20. [gpg]
  21. program = /path/to/gpg2
  22. You may also like to tell ``gpg`` which ``tty`` to use (add to your shell rc file)
  23. ::
  24. export GPG_TTY=$(tty)
  25. Creating commit links to lore.kernel.org
  26. ----------------------------------------
  27. The web site http://lore.kernel.org is meant as a grand archive of all mail
  28. list traffic concerning or influencing the kernel development. Storing archives
  29. of patches here is a recommended practice, and when a maintainer applies a
  30. patch to a subsystem tree, it is a good idea to provide a Link: tag with a
  31. reference back to the lore archive so that people that browse the commit
  32. history can find related discussions and rationale behind a certain change.
  33. The link tag will look like this:
  34. Link: https://lore.kernel.org/r/<message-id>
  35. This can be configured to happen automatically any time you issue ``git am``
  36. by adding the following hook into your git:
  37. .. code-block:: none
  38. $ git config am.messageid true
  39. $ cat >.git/hooks/applypatch-msg <<'EOF'
  40. #!/bin/sh
  41. . git-sh-setup
  42. perl -pi -e 's|^Message-Id:\s*<?([^>]+)>?$|Link: https://lore.kernel.org/r/$1|g;' "$1"
  43. test -x "$GIT_DIR/hooks/commit-msg" &&
  44. exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"}
  45. :
  46. EOF
  47. $ chmod a+x .git/hooks/applypatch-msg