How to Add Linux Executable Files to .gitignore?

How do you add linux executable files to .gitignore without giving them an explicit extension and without placing them in a specific or /bin directory? Most are named the same as the C file from which they were compiled without the ".c" extension.


Solution 1:

Can you ignore all, but source code files?

For example:

*
!*.c
!Makefile

Solution 2:

I would explicitly put them in the project .gitignore. It's not elegant, but I imagine your project doesn't have that many of them.