git add only part of file code example
Example 1: git add only text files from directory
$ git add Documentation/\*.txt
Example 2: git add all except one file
git add -u
git reset -- main/dontcheckmein.txt
where main/dontcheckmein.txt is the unwanted file.