search

Home  >  Q&A  >  body text

gitignore file usage

In the .gitignore file, what is the difference between the following two lines?

/data/cache/
/data/cache/*

怪我咯怪我咯2794 days ago605

reply all(3)I'll reply

  • 某草草

    某草草2017-05-02 09:36:20

    Look here:

    If the pattern ends with a slash, it is removed for the purpose of the
    following description, but it would only find a match with a

    1. In other words, foo/ will match a directory foo and paths

    2. it, but will not match a regular file or a symbolic link

    foo (this is consistent with the way how pathspec works in general in
    Git)

    In my opinion, there is no difference between these two commands. All content in the directory /data/cache/ is filtered

    reply
    0
  • PHP中文网

    PHP中文网2017-05-02 09:36:20

    .gitignoreThe configuration file is used to configure files that do not need to be added to version management. Configuring this file can bring great convenience to our version management.

    • Start with a slash "/" to indicate a directory;

    • Use asterisk "*" to wildcard multiple characters;

    • Use question mark "?" to wildcard a single character;

    • A match list containing a single character in square brackets "[]";

    • Use an exclamation mark "!" to indicate that the matched files or directories will not be ignored (tracked);

    Hope it helps you

    reply
    0
  • PHP中文网

    PHP中文网2017-05-02 09:36:20

    Although the meaning is different, the implementation effect is the same. They all block files in a certain directory.

    reply
    0
  • Cancelreply