gitignore binary files that have no extension

前端 未结 18 1253
没有蜡笔的小新
没有蜡笔的小新 2020-11-28 02:14

How can binary files be ignored in git using the .gitignore file?

Example:

$ g++ hello.c -o hello

The

18条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-28 02:42

    Add the following to your .gitignore file:

    [^\.]*
    

    Explanation:

    [] encloses a character class, e.g. [a-zA-Z] means "any letter".
    ^  means "not"
    \. means a literal dot - without the backslash . means "any character"
    *  means "any number of these characters"
    

提交回复
热议问题