Git: Selectively Commit Files

git commit commits changes currently in the staging area (changes that have been added using git add).

What you usually do is git add . or git commit -am'My commit message'.

To do a selective commit, e.g. only for a specific file type, use git add [any wildcard expression] followed by git commit.

$ git add *java
$ git commit