Ignoring TypeScript generated files from Git

22. April 2019 16:41 by Cameron in Git, javascript, TypeScript  //  Tags: , , , , , , ,   //   Comments

I recently started a project with TypeScript and found that the js and js.map files were being added to my repository. These files are automatically generated with each build of your TypeScript code so they're not needed in the repository. To remove these if you've already added them, run the following:

git rm src/**/**/*.js
git rm src/**/**/*.js.map

Following that, you can add these lines to your .gitignore to ensure they're not added back:

src/**/**/*.js
src/**/**/*.js.map
blog comments powered by Disqus

Month List

Tag cloud