what does tmp/**/* ignore in .gitignore?
In my .gitignore file I have
tmp/**/*
What files does it exclude? Will it exclude all tmp and files/folders under it?
My other question is, is this different from the following?
tmp/*
Edit:
Rea开发者_如何学Pythonson I ask is because I a have this
.vimbackup/**/*
but it is NOT ignoring a file like .vimbackup/.somebackup~
However, if I do
.vimbackup/*
it DOES ignore the file .vimbackup/.somebackup~
Seems kinda backwards to me
Usually that notation means to include any subdirectory within tmp. And then files within those directories too (because of the additional /*
)
It includes sub-directories recursively as well. So tmp/billy/bob/*
will be ignored as well as tmp/banjo/*
and so on...
That being said. I've never used git... so I could be wrong. But many IDEs and version control programs use that notation.
Just noticed your second question. Yes it is different from just tmp/*
Which will ignore all files, but not directories and their respective files.
If a file has already been committed then git will remember it until you explicitly get git to remove it from the index/staging area. This is even if you update the .gitignore file, which can be confusing.
look at git rm <file>
for removing a file that has been previously committed that you are now ignoring via the .gitignore file (see many SO Q&As).
精彩评论