git ignore files (ignore file)

Source: Internet
Author: User

Ignore files

The following ignore files are in the format below:

#  lines starting with ' # ' are treated as comments .                                                                                                                                &NBSP

#  ignores all files with file names that are  foo.txt.

Foo.txt

#  ignores all generated  html files,

*.html

The

# foo.html is manually maintained, so the exception is.

!foo.html

#  ignores all. O and  .a files.

*. [OA]

Steps

Create a new file named . Gitignore in the warehouse directory (because it is the point at the beginning, no file name, no way directly in the Windows directory directly created, you have to right-click Git Bash, in accordance with the Linux way to new . Gitignore files). As shown in.

The. gitignore file is valid for both the directory in which it resides and all subdirectories of the directory in which it resides. By adding the. gitignore file to the warehouse, other developers update the file to the local repository to share the same set of ignore rules.

Example

# Ignore *.O and *.A files

*. [OA]

# Ignore *.b and *. b file, except my.b

*. [BB]

!my.b

# Ignore DBG files and dbg directories

Dbg

# only the DBG directory is ignored and the DBG file is not ignored

dbg/

# only the DBG file is ignored and the DBG directory is not ignored

Dbg

!dbg/

# only the DBG files and directories in the current directory are ignored, and the dbg of subdirectories is not in the Ignore range

/dbg

Common ignore Phpstorm project configuration files:

. idea/

git ignore files (ignore file)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.