Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not ignoring .git files, despite being put in ignore params #208

Open
jadchaar opened this issue Aug 9, 2017 · 7 comments
Open

Not ignoring .git files, despite being put in ignore params #208

jadchaar opened this issue Aug 9, 2017 · 7 comments

Comments

@jadchaar
Copy link

jadchaar commented Aug 9, 2017

Hello! Really enjoying live-server, but I find that my level 2 log output gets cluttered quickly because a change is constantly detected in the file ./.git/index. I tried adding .git to my ignore params field, but it did not work. Things I tried in params: ignore: .git, ignore: .git/*, ignore: .*, and ignore: .git/**. Would love some help! Thanks.

@pavelbinar
Copy link

pavelbinar commented Nov 15, 2017

Hi, same story here.

This does not work for me:

live-server --ignore=".git, .idea"

I think the simple example in the readme for the CLI inputs would be great.

Thank you!


$ node --version
v8.9.0

$ live-server --version
live-server 1.2.0

@sebastianovide
Copy link

I was going to investigate it and possible fix it but after seeing 14 pull requests I wonder if this project is still maintained..

@acarabott
Copy link

acarabott commented Nov 29, 2017

I had a bit of a dig into it and I believe it is an issue with the underlying use of chokidar, but it's a bit of a ball of mud to try and sort out.

While the docs say --ignorePattern is deprecated, it still works so use --ignorePattern=".git*" and for multiple items e.g. a directory called docs use --ignorePattern=".git*|docs/*"

@devinrhode2
Copy link

Docs need some updating.. see: #178
@tapio @pavel this can be closed

@unitof
Copy link

unitof commented Nov 1, 2019

Note: the solution (from #178) is to explictly tell live-server to start in the current directory (./). Then it will properly resolve --ignore paths:

live-server --ignore=.git,node_modules ./

@belachkar
Copy link

belachkar commented Dec 9, 2019

A hard looking for solution:

live-server --port=8000 --watch=./** --ignore=./dist/app.bundle.js.map,./src ./

./ To start on the current directory as @unitof said.
--watch=./** To watch for all changes starting from the current directory.
--ignore=./dist/app.bundle.js.map,./src To ignore the files and folders with a relative path.

@dotchev
Copy link

dotchev commented Nov 25, 2020

This also seems to work

live-server --ignore="$PWD/.git/**"

Ideally relative paths should be resolved to absolute paths
...
The issue seems to be that by default the root dir is process.cwd() which is an absolute path, so ignore patterns should match against absolute paths. Considering that these are patterns, probably it would not be easy to resolve them to absolute patterns. So the best option seems to pass . as root dir as suggested above.
Probably not a bug, but should be documented to avoid surprises.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants