Sometimes you have to put some files in the GIT working directory. However, they cannot be submitted, such as a configuration file that holds the password for a database, and each git status will
Show "untracked files", if you have obsessive-compulsive disorder in your heart must be uncomfortable.
Git is a human tool, and the problem is to provide a solution. Create a special. gitignore file in the root directory of the Git workspace, then fill in the ignored file name,
Git will automatically ignore these files.
No need to write from scratch. Gitignore file. GitHub has prepared a variety of configuration files for us, only a combination to use, all the configuration files can be directly browsed:
Https://github.com/github/gitignore
The principle of ignoring files is:
- Ignore files that are automatically generated by the operating system
- Ignore compile-generated intermediate file, executable file
- Ignore your own files with sensitive information
Git ignores features of special files