1

I want add all files that start with syslog on my host to git. That seems crazy, but I think it could manage some config snippet to git repository.

My .gitignore is:

$ cat /.gitignore
/*
!/**/sysgit*

But it can't pick up a file at /Users/myusername/tmp/sysgit_test with git status.

Does git support this?

  • Is sysgit a typo for syslog? If so, is it just a typo here or does it appear in your actual .gitignore? – Matthieu Moy May 24 '18 at 15:46
0

This is expected, according to man gitignore:

Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined.

git status --untracked=all is very close to solving your problem, but still doesn't show untracked files in subdirectories. This one looks like a bug actually.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.