My programs generally generate huge output files (~1 GB) which I do not want to be backing up to the git repository. So instead of being able to do
git add
The best solution to achieve this
create .gitignore
file in repository root
, and if you want to include only .c
file then you need to add below lines to .gitignore
file
*.*
!*.c
this will include all .c
file from directory and subdirectory recursively.
using
*
!*.c
will not work on all version of git.
Tested on
git version 2.12.2.windows.2