Home > OS >  gitIgnore - Include a file from a package inside node_modules
gitIgnore - Include a file from a package inside node_modules

Time:02-07

I have ng-payment-card package and I've made some modifications in a file inside the package, and I need to include this file in the git commit in order to not reset it every time I make npm install.

I tried to write in .gitignore like this:

!/node_modules/ng-payment-card/__ivy_ngcc__/fesm2015/ng-payment-card.js

but the same, the file hasn't been added to the commit.

CodePudding user response:

Even if the file is currently ignored, you can force adding it:

git add --force  node_modules/ng-payment-card/__ivy_ngcc__/fesm2015/ng-payment-card.js

That way, everything else remains ignored, while your file becomes tracked.

  •  Tags:  
  • Related