I recently received a request that I start a “Dear Jacob” advice column for git, and thought that it was a pretty nifty idea. I needed a good excuse to post more frequently, and I do end up answering a lot of questions about Git for the people that I know.
Welcome to the first installment of the “Dear Jacob” Git advice column!
The first tip comes about because of wanting to add all of the modified files to the index, without adding any test, or experimental files that might also be in your tree.
Anyway, the disjunction resulted in the person doing
git diff --name-only | xargs git add whenever they wanted to add only the modified files in their repo. They couldn’t use
git add . to add everything, since they potentially had some test/experiment files that they didn’t want to track.