I’m trying to use environment variables for my Git configuration.
The article Carrying your Git settings around provides a good starting point.
You can set GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITER_EMAIL and GIT_COMMITER_NAME as environment variables in your bash configuration.
Or, if you’re using fish, you can set universal variables with set -Ux.
For example,
set -Ux GIT_AUTHOR_NAME 'John Doe'