Github .gitignore provide this functionality, you can specify which files they can not be managed. The specific method is in the root directory of version management (with the same level .git folder) to create a .gitignore.
The project has three clist.h clist.c main.c file, compiler implementation, generate three files clist.o main.o main. These three documents is that no version management, it is necessary to ignore these files, use git stauts view, we found these three documents also state in Untracked files. And we really do want to ignore him.
Use gitignore file to solve this problem, the steps are:
S1: touch .gitignore # Create gitignore hidden files
S2: vim .gitignore # Edit the file, add the specified file
# The following is the content of my gitignore file
# Ignore gitignore file
# Ignore the file name suffix .o and .a's
# Display the name of the main file is ignored
.gitignore File format specification:
# Is a comment
You can use the shell used regular expressions for pattern matching
Last match mode with the "/" directory is described to be ignored
use! Negated (such as a directory contains test.a, and gitignore file contains *. [Oa], if added to the file! Test.a show ignore suffixes other than test.a file named .a or .o files )
After configuring .gitignore file, execute git status command, you will find three files that are no longer Untracked files, and also completed the function ignores the specified file.