Search code examples
gitversion-controlcommitfile-extension

Is there a way to just commit one file type extension from a folder?


I have a folder with a lot of stuff and I would like just to commit ".c" extension files. Is there a command to do this or do I need to add each file name manually?


Solution

  • If you want to add all files with a specific file extension, all you have to do is specify it at the time you go to stage the files using a wildcard.

    git add \*.c

    Here .c can be any extension you want.