mistre83's avatar

.gitignore build folder

Hi to all, with elixir i compile javascript and less and after that, i use versioning:

mix.version([
    "public/css/core.css",
       "public/js/core.js"
]);

This file go in /public/build/ folder and sure i would like to ignore it, so in .gitignore i have added

/public/build

But, every time i run gulp watch those files will be modified (compiled) and when i commit, this file "come in there", but i have excluded them in .gitignore.

Its like after gulp watch, file in /public/build are no longer ignored.

0 likes
8 replies
mistre83's avatar

I have tried all the options:

/public/build
/public/build/**
public/build

and all other slash combinations.

I have tried to add single .gitignore everywhere... but... the result is the same.

primordial's avatar

Is it already under revision control? Try removing it from git first.

mistre83's avatar

Mhhh what you mean with "revision control"?

primordial's avatar

Sounds like your build folder is already registered with Git and inside your git repository hence it will ignore the contents .gitignore file.

Try

git rm -r public/build
git commit m "remove from git"
git push

then try

git status

hopefully it will ignore the folder according to the contents of your .gitignore file.

1 like
mistre83's avatar

When i build with versioning, this generate two files:

.map
file-{version_number}.css

I noticed that git "add" just the map file, and not the "versioned". Sure... because the folder is entire in ignore... show ignore all... not just a part of it..

primordial's avatar

I'm not sure what you mean by your last post but you need to remove the entire folder from git then it will be ignored moving forward.

Please or to participate in this conversation.