Carlos Bolivar
Carlos Bolivar

Reputation: 317

.gitignore two or more extensions file

I have the next files in my local repository:

app.component.js core.component.js core.service.local.js core.service.power.ts

My question is very simple, How can I do to ignore the files with the extension .component.js and .service.local.js and other, I mean any file to end with .Any_String.ext

Upvotes: 1

Views: 1839

Answers (2)

danglingpointer
danglingpointer

Reputation: 4920

The easiest way is to add these to your .gitignore file.

use this command to stop tracking the specific file

git rm --cached .

or

In this case you can stop tracking the below file.

git rm --cached public/app/core.service.local.js

or

Add these in your gitignore file. I'm not sure you want to skip all files with *.component.js or just only these 4 files.

app.component.js
core.component.js
core.service.local.js
core.service.power.ts

Or use wildcard representation and make sure you ignore unwanted files only.

Upvotes: 0

quinz
quinz

Reputation: 1342

Use a wild character '*'. Example *.component.js

Upvotes: 4

Related Questions