Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore js files on a specific subfolder?

I have the following structure

structure

I want to tell .gitignore to ignore js, map file types.

I tried the following

# =========================
# Web essentials auto-generated files
# =========================
TypeScript.Content/Scripts/*.js
TypeScript.Content/Scripts/*.js.map

But when I change the js file (or 'create' it) it adds to the list of pending changes...

Is something wrong?

like image 488
BrunoLM Avatar asked Jun 30 '13 08:06

BrunoLM


1 Answers

It seems that the .js and .map files that you wish git to ignore are already present in the index. You need to tell git to un-track those files:

git rm --cached TypeScriptTest.Content/Scripts/*.js
git rm --cached TypeScriptTest.Content/Scripts/*.js.map

Quote from GitHub help on Ignoring files:

Note that git will not ignore a file that was already tracked before a rule was added to this file to ignore it.

like image 186
devnull Avatar answered Sep 21 '22 10:09

devnull