• .gitignore 只包含几个文件


    ##去除哪些路径 
    /*
    ## 保留哪些文件
    !my.cnf   //          
    

    学习其他的

    *
    !/**/
    ##去除哪些路径
    /dirignore1/
    /dirignore2/
    ##只包含哪些结尾的文件
    !*.c
    !*.h
    !*.cpp
    !*.sh
    !*.xml
    !*.py
    !*.md
    !*.jar
    !.scala
    !.java
    

    1 * 代表忽略全部

    2 /** 代表文件夹下的全部内容 ( A trailing "/" matches everything inside. For example, "abc/" matches all files inside directory "abc")

    为什么要写这句,因为不可能包含一个文件,如果他的文件夹都被忽略了 It is not possible to re-include a file if a parent directory of that file is excluded. (*)

    3 包含每个文件后,/dirignore1/, 在去除不需要的文件夹。(可以注意到.gitignore是按照顺序读入规则的,顺序重要)

    4 ! 在每行前加感叹号,表示需要包括后面的匹配文件或文件夹

    5 /, 连续两个* 表示包含文件夹下的所有内容 (A trailing "/" matches everything inside. For example, "abc/**" matches all files inside directory "abc")

    6 (只有在没有 “/” 符号的前提下 , 才会作wildcard匹配, 所以模版中不能加"/"这种路径操作) If the pattern does not contain a slash /, Git treats it as a shell glob pattern and checks for a match against the pathname relative to the location of the .gitignore file

    原文链接:https://blog.csdn.net/u011467621/article/details/79108980

    写入自己的博客中才能记得长久
  • 相关阅读:
    include包含文件查找的顺序
    cookie知多少
    关于“异步可插协议”(About Asynchronous Pluggable Protocols(APPs))
    win7+vs2010下编译chrome
    chrome命令行参数
    头文件预编译
    IBindStatusCallback 状态码
    DEP相关
    调试子进程
    windbg 调试
  • 原文地址:https://www.cnblogs.com/heris/p/15687996.html
Copyright © 2020-2023  润新知