I have a configuration file abc.cfg with local changes for my environment. To prevent pushing local configs to the remote, I use git update-index --skip-worktree abc.cfg on the file.
Now the upstream has changed abc.cfg with global updates that I need. So I first did --no-skip-worktree abc.cfg, did git stash on it, pulled the upstream, and proceed with git stash apply on the file.
Now there's merge conflicts on abc.cfg. I tried to resolve it, and do git update-index --skip-worktree abc.cfg again, but this time it says:
fatal: Unable to mark file scripts/app.js
How should I apply back my local changes without including it in the commits?
I think your project is a mobile application project as you have error in scripts/app.js
You are applying stash, still ignoring it and not want to push your local changes, thats fine. There should not be any issue due to this.
Now, the error you got
fatal: Unable to mark file scripts/app.js, I guess its due to the changes you pulled from remote. Do this, take a fresh copy of remote at different location and use any compare tool to see what all files are different in two projects specially the app.js file.