Repository navigation
Description
Describe the bug
I cannot commit to the excalidraw/excalidraw repo in GitHub Desktop. Using GitUp (another GUI) or the git CLI both work fine.L
Version & OS
GitHub Desktop Version 2.4.0, macOS Version 10.15.3 (19D76)
Steps to reproduce the behavior
- Clone
https://github.com/excalidraw/excalidraw - Run
npm installto install the dependencies - Open the repo in your favorite editor and delete lines 8–18 of
src/index.tsxso you have something to commit. - In GitHub Desktop, commit the change.
Expected behavior
The commit occurs successfully.
Actual behavior
An error dialog displaying this text:
Details
Commit failed - exit code 1 received, with output: 'husky > pre-commit (node v13.11.0)
Preparing... [started]
Preparing... [failed]
→ error: unknown option 'ignore-skip-worktree-entries'
usage: git update-index [<options>] [--] [<file>...]
[removed: listing of all options]
Cannot save the current worktree state
Running tasks... [started]
Running tasks... [skipped]
→ Skipped because of previous git error.
Applying modifications... [started]
Applying modifications... [skipped]
→ Skipped because of previous git error.
Cleaning up... [started]
Cleaning up... [skipped]
→ Skipped because of previous git error.
✖ lint-staged failed due to a git error.
Any lost modifications can be restored from a git stash:
> git stash list
stash@{0}: On master: automatic lint-staged backup
> git stash pop stash@{0}
error: unknown option 'ignore-skip-worktree-entries'
[removed: listing of all options]
Cannot save the current worktree state
husky > pre-commit hook failed (add --no-verify to bypass)
Additional context
I’m guessing this is because --ignore-skip-worktree-entries was recently added to Git and Husky is using Desktop’s bundled version for some reason?
Yesterday we shipped GitHub Desktop 3.5.5-beta1 to our beta channel with improved support for hooks related to committing.
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.
Activity
rafeca commentedon Mar 26, 2020
Thanks for reporting @j-f1 !
After some offline discussion with @j-f1 , he realized that the issue comes from the
lint-stagednpm package.These are the events that I think are happening based on the conversation with @j-f1 (I haven't been able to reproduce the problem in my machine though, so take this with a grain of salt):
huskycreates apre-commitgit hook, which gets executed by the version ofgitthat gets bundled by Desktop.pre-commithook executes anshscript that ends up executinglint-stagedon theexcalibur/excaliburproject (source).pre-commithook gets executed with theGIT_EXEC_PATHenv variable set to the path of the git binary bundled in Desktop and adds its path to the beginning of thePATHenv var.lint-stagedrunsgit stash save --include-untracked --keep-index 'lint-staged automatic backup'(source).gitbinary used for the previous command gets resolved to the system version ofgit(I have no idea why this happens???lint-stagedusesexecato executegit).gitis above v2.25.0, thegit stashcommand will internally callgit update-index --ignore-skip-worktree-entries -z --add --remove --stdin(source).gitcommand will get executed using the git binary bundled in Desktop (thanks to theGIT_EXEC_PATHenv var).--ignore-skip-worktree-entriesparam so the command fails.Based on the sourcecode of
git stash, looks like this behaviour can be avoided by using setting thestash.useBuiltinconfig param tofalse(this way, the old legacy stash logic will get executed):$ git config stash.usebuiltin false(this is just a potential workaround and may cause other issues).
The main question here is regarding point 5., and why does
lint-stagedignores the path and resolves to the system git binary in some systems. I think that if we can figure out that issue and resolve it, this issue will go away.rafeca commentedon Mar 27, 2020
I've confirmed with @j-f1 that
git config stash.usebuiltin falsefixes the issue, so this can be used as a workaround.It's still unclear why does lint-staged executes the system git binary in some systems. This could probably be caused by some specific bash configuration...
Anyways, I see 3 different things going on here:
git, which causesgitto spawn internally a binary of a different version causing failures when usingGIT_EXEC_PATH.Maybe we can refocus this issue (or create a new issue) to try to address point 3. so:
[-]Husky pre-commit failure[/-][+]Improve context on pre-commit failures and provide escape hatch[/+][-]Improve context on pre-commit failures and provide escape hatch[/-][+]Improve context on pre-commit hook failures and provide escape hatch[/+]steveward commentedon Feb 19, 2021
Feedback from #11626, where the option to provide a "Commit anyways" option was requested:
billygriffin commentedon Mar 15, 2021
This came up again in #11802. If a contributor wants to take a crack at adding a "Commit anyway" button to the error dialog, I think that'd be a great next step.
mosherc commentedon Nov 12, 2021
Any movement on this?
CodingSamurai commentedon Nov 29, 2021
Another vote for making this happen.
jbvsmo commentedon Dec 23, 2021
Why can't there be a button to "commit anyway" on the error window that uses --no-verify?
That is a no brainer since this window only shows for people with pre-commit.
I've been trying to move to github desktop from another gui tool, but I guess I might have to find yet another option
Revert "Upgrade package "husky""
mchammer01 commentedon Feb 1, 2022
A ➕ to make this happen
bernardobarreto commentedon Feb 17, 2022
A ➕ to make this happen [2]
ikhurramraza commentedon Apr 25, 2022
A ➕ to make this happen [3]
james70s commentedon Apr 26, 2022
A ➕ to make this happen [4]
24 remaining items
JonasJore commentedon Aug 20, 2024
Is this feature going to happen? It would be really nice 💯
modelrailroader commentedon Aug 24, 2024
A ➕ to make this happen [21]
thibaut-pro commentedon Aug 29, 2024
A ➕ to make this happen [22]
shubham-wynk commentedon Sep 12, 2024
A ➕ to make this happen [23]
shubh710 commentedon Sep 12, 2024
@steveward I would love to pick this up, request you to assign this to me.
jmechamFD commentedon Sep 12, 2024
I see most of the discussion in this is about commit hooks, just want to suggest push hooks should have this feature as well.
alvarohulse commentedon May 22, 2025
@billygriffin Is this option still available? I'd assume so, but 2 things make me wonder:
Regardless, I'll take a crack at it in ~ a week, referencing @Yohannfra's changes.Yohannfra commentedon May 22, 2025
I almost forgot about this PR. It was a deal breaker for me and I moved to Sublime Merge ever since. Good luck with this PR.
noerbot commentedon Jul 30, 2025
FWIW I found the "Skip Hooks" option of Git Tower super useful, especially on repos with really strict/extensive pre-commit hooks.
mosherc commentedon Aug 26, 2025
@billygriffin and everyone else, I opened a PR according to your suggestion here, where this is only available as an option when pre-commit hooks are detected in a pre-commit hook failure specific dialog. Failures are detected by standard husky/lint-staged error messages. This may or may not work for custom implementations of pre-commit hooks and staged file linting, but should cover all off-the-shelf usage of husky and lint-staged, and varies otherwise.
niik commentedon Jan 14, 2026
Yesterday we shipped GitHub Desktop 3.5.5-beta1 to our beta channel with improved support for hooks related to committing.
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.
anastasiia-matiushenko commentedon Feb 4, 2026
if anyone already tried this feature in Github Desktop?
I installed it and ticked "Load Git hook environment variables from shell" in Settings. but if I commit anything, there's no section like on a first screenshot above "pre-commit hook running...", just a regular commit happens
does it work only for some specific commits?
niik commentedon Feb 4, 2026
Hi @anastasiia-matiushenko, thanks for reaching out. Hooks support should work for all repositories with properly configured pre-commit hooks. The fact that you've got hooks support enabled and that you're not seeing the gear icon in the commit message description area tells me that GitHub Desktop doesn't believe that there's a pre-commit hook set up for your repository.
Can you open a terminal and run
ls -l .git/hooksin your JS-Fundamentals folder and paste the output here so that I can have a look at how your hooks are set up?