gitignore binary files that have no extension

前端 未结 18 1223
没有蜡笔的小新
没有蜡笔的小新 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:20

    I don't know any other solution but adding them one by one to .gitignore.

    A crude way to test is to grep the file command's output:

    find . \( ! -regex '.*/\..*' \) -type f | xargs -n 1 file | egrep "ASCII|text"
    

    EDIT

    Why don't you simply name you executable hello.bin?

提交回复
热议问题