I have a bunch of deleted files in my working branch that I\'m not sure I want to commit yet. I need to commit my modified files as needed though.
This is what I came
Just use git add --no-all .
(Git v. 2.0+) or git add .
(Git v. 1.x). This will pick up any files it can find by traversing the current directory, which naturally won't include deleted files.
Of course, this also picks up any untracked files too. If you need to avoid those, then you can use a more complicated expression. It's similar to yours, but it uses the output that's intended for scripting (so it's more stable and easier to parse):
git diff-files -z --diff-filter=M --name-only --relative | xargs -0 git add