Whenever I am trying to deploy my react app on gh-pages this error is coming
Cloning into 'C:\Users\Yasin\Desktop\HTML Projects\igvio-main\node_modules.cache\gh-pages\https!github.com!yasin-ai!igvio.git'... error: unable to create file src/Media/4VGWsLNGhpXExFXdvAMxJ8Y7WxN-NoHaa0Jf01NNjWEZvR9IbI56c2-VrjIsmgZ0Cugensf-3qJDt3tkSRV-Y2LYGHrcPDJJmLPf9zpqFq94ocq16seQT0queKpLauUjwFKD2e7NZbs2jSDeJz0sx_1wr__psiwBSqkrW9kTiTPoe: Filename too long fatal: unable to checkout working tree warning: Clone succeeded, but checkout failed. You can inspect what was checked out with 'git status' and retry with 'git restore --source=HEAD :/'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Yasin\AppData\Roaming\npm-cache\_logs\2022-08-17T14_07_49_625Z-debug.log
PS C:\Users\Yasin\Desktop\HTML Projects\igvio-main> git config --system core.longpaths true
error: could not lock config file C:/Program Files/Git/etc/gitconfig: Permission denied
CodePudding user response:
This was due to long file names and doing a simple config as below resolved it
git config --system core.longpaths true
or another solution is try using this
git reset