I find /*
and *
has different means when I compare with the setting:
*
!/init.el
!/README.md
!.gitignore
!/lib/
VS
/*
!/init.el
!/README.md
!.gitignore
!/lib/
The former not track /lib/
but the latter track it.
How to undertand *
and /*
?
UPDATE
I think this question is not exactly same as another one. Because he is focus on dir/**
and dir/*
but this one is focus on /*
and *
.
The first version ignores all files except those listed explicitly. lib
is ignored because it contains no trackable files. Git does not track folders, so directories that appear empty seem to get ignored.
The second version ignores all root level files and directories except those listed explicitly. It does not ignore anything that is trackable and not in the root directory. lib
is listed explicitly, so it is not ignored. Any files it contains are not at the root level, so they aren't ignored either.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With