patch-package icon indicating copy to clipboard operation
patch-package copied to clipboard

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

Open leonknight9125 opened this issue 2 years ago • 1 comments

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

• Creating temporary folder • Installing [email protected] 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 avatar Jul 22 '23 14:07 leonknight9125

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.

leonknight9125 avatar Aug 23 '23 14:08 leonknight9125