Comments in .gitignore?

后端 未结 2 1822
离开以前
离开以前 2020-12-07 09:47

Can you write comments in a .gitignore file?

If so, should the line be preceded with a # or some other indicator?

相关标签:
2条回答
  • 2020-12-07 10:18

    Do git help gitignore

    You will get the help page with following line:

    A line starting with # serves as a comment.
    
    0 讨论(0)
  • 2020-12-07 10:20

    Yes, you may put comments in there. They however must start at the beginning of a line.

    cf. http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository#Ignoring-Files

    The rules for the patterns you can put in the .gitignore file are as follows:
    - Blank lines or lines starting with # are ignored.
    […]

    The comment character is #, example:

    # no .a files
    *.a
    
    0 讨论(0)
提交回复
热议问题