Git's. Gitignore Configuration

Source: Internet
Author: User

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

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.