. gitignore
GitHub offers. Gitignore This feature allows you to specify which files can be managed without your own. The specific method is to create a. Gitignore under the root directory of the version management (with the. git folder sibling).
Application examples
The project has clist.h clist.c main.c three files, compiled after execution, generated three files clist.o main.o main. These three files do not need to be versioned, so you need to ignore these files, using Git stauts view, found that the three files are also in the untracked files state. And we're actually trying to ignore him.
Use the Gitignore file to work around this problem, as follows:
S1: touch . Gitignore #创建gitignore隱藏文件 S2: vim . Gitignore #编辑文件, adding the specified file #下面是我的gitignore文件的内容 #忽略gitignore文件 . Gitignore #忽略后缀名为. O and. A Files *. [ OA] #显示指定忽略名称为main的文件 main
Format specification for file. Gitignore:
- #为注释
- Pattern matching can be done using regular expressions used by the shell
- Match mode last followed by the "/" description to ignore is the directory
- Use! Reverse (for example, the directory contains TEST.A, and the Gitignore file contains *. [OA], if added in the file! TEST.A indicates that the suffix named. A or. o is ignored except for the test.a file)
After configuring the. gitignore file, executing the git status command will find that the three files are no longer untracked files, and have completed ignoring the specified file.
I'm the dividing line of the king of the Land Tiger.
Reference: http://blog.csdn.net/cscmaker/article/details/8553980
GitHub uses. Gitignore to ignore specified files