Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 1.32 KB

manual_setup.md

File metadata and controls

36 lines (24 loc) · 1.32 KB

Manual Setup

  • Set a global githooks directory

    $ mkdir -p ~/.git/hooks
    $ git config --global core.hooksPath "~/.git/hooks"
  • Download the prepare-commit-msg file into the directory

  • Ensure it is set as executable (Linux and macOS)

    $ chmod +x ./prepare-commit-msg

    This githook will append the Co-authored-by trailers to the commit message.

    If you want this githook to add a Jira Issue ID as a prefix to the commit message when the git branch name begins with a string resembling one, uncomment line 12 to call the function add_jira_issue_id_prefix.

If a repository overrides core.hooksPath git configuration variable (e.g when using husky), then you will need to do additional steps for each such repository

  • Retrieve the local (repository-specific) hooks directory

    $ git config --local core.hooksPath
  • Download the prepare-commit-msg.local as prepare-commit-msg file into the directory

  • Ensure it is set as executable (Linux and macOS)

    $ chmod +x ./prepare-commit-msg

    This githook will invoke the global prepare-commit-msg githook that you originally set up.