ds300 / patch-package

Fix broken node modules instantly 🏃🏽‍♀️💨
MIT License
10.48k stars 295 forks source link

"fatal: --local can only be used inside a git repository" when diffing files #478

Open leonknight9125 opened 1 year ago

leonknight9125 commented 1 year ago

Just simply running "npx patch-package XXX" to patch a package and resulting error:

• Creating temporary folder • Installing node-hls-downloader@2.2.0 with npm
• Diffing your files with clean files fatal: --local can only be used inside a git repository

patch-package version: 7.0.2

leonknight9125 commented 1 year ago

It's was found out that the issue was caused by newer version of git. I'm using Git for Windows with latest version 2.42.0-64-bit, it will cause such error. Downgrading git to 2.36.1-64-bit will resolve such issue.

Now it is still not sure which breaking changes from git will cause the error.