This is how to specify ".gitignore" file to exclude log files, cache files, etc. which do not need to be registered in Git.
Actually there are various designation methods, but for now, you should remember this only.
|Exclude any file type (extension)||*.log|
|Directories in all hierarchical directories||dir_name|
|*||0 or more character strings (other than /)|
|**||0 or more files, directories (/ including)|
For all hierarchical directories, we only list those that are excluded collectively. Let's just remember this for the time being.
Since it becomes detailed setting, it should be described as necessary.
How to use the pattern (**) is like this.
Suppose the directory structure is as follows.
dir1 |- dir2 | |- dir5 | |- dir8 | |- dir3 | |- dir6 | |- dir8 | |- dir4 | |- dir7 | |- dir8
Specifying "**/dir5" results in the same result as "dir5". Use this directory if you have a directory with the same name and want to exclude only a part of it.
If specified like this, only dir8 under dir2 will be excluded. You can also exclude specific files by adding a file name pattern to the back.