I tried to make an alias for committing several different git projects. I tried something like
cat projectPaths | \\
xargs -I project git --git-dir=project/.gi
The man page for GNU xargs
shows a similar command for emacs:
xargs sh -c 'emacs "$@" < /dev/tty' emacs
(in this command, the second "emacs" is the "dummy string" that wisbucky refers to in a comment to this answer)
and says this:
Launches the minimum number of copies of Emacs needed, one after the other, to edit the files listed on xargs' standard input. This example achieves the same effect as BSD's -o option, but in a more flexible and portable way.
Another thing to try is using -a
instead of cat
:
xargs -a projectPaths -I project git --git-dir=project/.git --work-tree=project commit -a
or some combination of the two.