Setting environment variables for SmartGit to use

1.7k views Asked by At

I have a pre-commit hook that runs some tests. This used to work great until the tests started to rely on environment variables. Is there a way to set those environment variables in SmartGit so the pre-commit tests can complete?

2

There are 2 answers

4
mstrap On

SmartGit will pass all environment variables of its own to the forked git process. Hence, if you make sure that SmartGit is started with the correct configuration, your pre-commit hook should work.

1
jaynetics On

Two options:

1) Add your variables to /etc/profile or /etc/launchd.conf and SmartGit will pick them up.

2) Simply launch SmartGit from the shell instead of the desktop environment and your variables from files such as ~/.bashrc will be present. (That's what I'm doing, using a brief alias for convenience.)