Populate Git Configuration With Environment Variables

08/21/20191 Min Read — In DevTools

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'