The. Gitignore configuration file is used to configure files that do not need to be added to the version management, which can be very convenient for our version management, and the following are some of the personal experiences of the configuration. Gitignore.
1. Configuration syntax:
Start with a slash "/" to indicate the directory;
Use the asterisk "*" to pass multiple characters;
With a question mark "?" Pass a single character
The square brackets "[]" contain a list of matches for a single character;
With an exclamation mark "!" Indicates that the matching file or directory is not ignored (tracked);
In addition, git matches the. Ignore profile in rows from top to bottom, meaning that if the previous rule matches a larger range, the subsequent rules will not take effect;
2. Example:
(1) Rule: fd1/*
Note: Ignore all contents of directory FD1, notice that either the/fd1/directory under the root directory or a subdirectory/child/fd1/directory, will be ignored;
(2) Rule:/fd1/*
Description: Ignores the entire contents of the/fd1/directory under the root directory;
(3) Rules:
/*
!. Gitignore
!/fw/bin/
!/fw/sf/
Description: Ignores all content, but does not ignore. gitignore files,/fw/bin/and/fw/sf/directories under the root directory;
Git's. Gitignore Configuration