gitgithubgithooks

Git's --no-verify option


I was having an issue committing my work to GitHub (the pre-commit check was failing), so I saw in one of the fixes suggested by Git to add --no-verify to bypass the pre-commit check and it worked. My question is will all future pre-commits be bypassed? Or is it just a one time thing?


Solution

  • No, it won't bypass any pushes or commits in the near future, unless:

    1. You have an alias that adds this by default within your .gitconfig
    2. You pass this flag every time you push or commit.

    Regarding the second point, you need to pass --no-verify every time for this to work.

    Option 1 Example

    .gitconfig

    Adding an alias to your git config (i.e. fcommit for force commit) would apply the --no-verify everytime.

    [alias]
            fcommit = commit --no-verify
    

    Usage

    git fcommit