发现在.gitignore中写一行:
admin.py
也会匹配到子目录下的admin.py(比如controllers/admin.py)。
于是去 http://git-scm.com/docs/gitignore 好好看了下,这一条应该是适用我的情况的:
If the pattern does not contain a slash /, Git treats it as a shell glob pattern and checks for a match against the pathname relative to the location of the .gitignore file (relative to the toplevel of the work tree if not from a .gitignore file).
就是说规则中不带/的就按照shell glob来,即按照glob规则和相对于.gitignore的所有pathname进行匹配。但是照这样来说,应该是*admin.py匹配controllers/admin.py,而 admin.py不应该匹配上这个pathname啊。
不知道是我哪里理解错了还是什么的,求解惑...
admin.py
也会匹配到子目录下的admin.py(比如controllers/admin.py)。
于是去 http://git-scm.com/docs/gitignore 好好看了下,这一条应该是适用我的情况的:
If the pattern does not contain a slash /, Git treats it as a shell glob pattern and checks for a match against the pathname relative to the location of the .gitignore file (relative to the toplevel of the work tree if not from a .gitignore file).
就是说规则中不带/的就按照shell glob来,即按照glob规则和相对于.gitignore的所有pathname进行匹配。但是照这样来说,应该是*admin.py匹配controllers/admin.py,而 admin.py不应该匹配上这个pathname啊。
不知道是我哪里理解错了还是什么的,求解惑...



