Skip to content

Add per-repository option to skip Git hooks for commits and pushes #20887

Closed

Description

@Katyaraa1

The feature request

Currently, GitHub Desktop always runs Git hooks (such as pre-commit, commit-msg, and pre-push) when committing or pushing changes.

While this is the correct default for most workflows, there are situations where a user may want to temporarily bypass hooks for a specific repository — for example:

  • Speeding up work in a repo with heavy lint/test hooks when prototyping.
  • Committing experimental code without triggering validation steps.
  • Working offline where hooks depend on network access.

At the moment, skipping hooks requires manually using the --no-verify flag in the command line for each commit or push, which defeats the purpose of using GitHub Desktop as a fully GUI-based workflow.

Proposed solution

Introduce a per-repository setting inside the Repository Settings → Git Config tab with a checkbox:

[ ] Skip Git hooks for commits and pushes in this repository

When enabled for the active repository:

  • All git commit calls in GitHub Desktop will automatically include --no-verify to skip pre-commit and commit-msg hooks.
  • All git push calls will automatically include --no-verify to skip pre-push hooks.

Benefits:

  • Gives users fine-grained control without disabling hooks globally.
  • Maintains the default safe behaviour (hooks enabled) for all repos unless explicitly changed.
  • Reduces the need to drop into the CLI for bypassing hooks.

Additional context

Here’s a proposed UI mockup for the new setting. The checkbox would be placed in the Repository Settings → Git Config tab, directly below the Name and Email fields, since it relates to repository-specific Git behaviour.

When checked, GitHub Desktop would automatically add --no-verify to git commit and git push commands for this repository, allowing users to bypass local Git hooks without affecting other repositories.

Image
Pinned by niik

Activity

  1. added
    triage
    on Aug 13, 2025
  2. github-actions commented on Aug 20, 2025

    @github-actions
    Contributor

    Thank you for your issue! We have categorized it as a feature request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.

    Unless you see the help wanted Issues marked as ideal for external contributors label, we are not currently looking for external contributions for this feature.

    If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.

  3. removed
    triage
    on Aug 20, 2025
  4. niik commented on Jan 14, 2026

    @niik
    Member

    Yesterday we shipped GitHub Desktop 3.5.5-beta1 to our beta channel with improved support for hooks related to committing.

    Screenshot showing the GitHub Desktop commit form as a pre-commit hook is running

    The support is experimental and currently limited to our beta channel. While we believe that this release resolved this issue we're looking for real-world feedback so if you have the ability we'd appreciate it if you could download our beta channel and give it a spin. Ensure the experimental hooks support it's enabled by going to Settings -> Git -> Hooks and making sure the "Load Git hook environment variables from shell" is ticked.

    Screenshot showing the hook settings dialog

    You can skip hooks entirely on a per-repository basis by checking the "Bypass Commit Hooks" option in the commit box.

    Image
  5. kositozzy-cyber commented on Mar 2, 2026

    @kositozzy-cyber

    #!/bin/sh

    コミット対象の編集された.xlsxファイルを取得

    xlsx_files=$(git diff --cached --name-only --diff-filter=ACM | grep '.xlsx$')

    .xlsxファイルがある場合はCheckSheetConflictを実行

    if [ -n "$xlsx_files" ]; then
    echo "Checking sheet conflicts for: $xlsx_files"

    # publishディレクトリのパスを取得
    repo_root=$(git rev-parse --show-toplevel)
    
    publish_dir="$repo_root/hoge/publish/mac"
    
    # Check if publish directory exists
    if [ ! -d "$publish_dir" ]; then
        echo "Error: Publish directory not found: $publish_dir"
        exit 1
    fi
    
    executable="$publish_dir/hoge"
    
    # CheckSheetConflictを実行
    "$executable" CheckSheetConflict $xlsx_files
    
    # 実行結果を確認
    if [ $? -ne 0 ]; then
        echo "CheckSheetConflict failed. Commit aborted."
        exit 1
    fi
    
    echo "CheckSheetConflict passed."
    

    fi

    exit 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions