bier hier bier hier - 1 year ago 178
Git Question

Set an environment variable in git bash

When I punch from the windows gitbash command line:

set $HOME = c

and do :

echo $HOME

It does not set it to
? How can I change/set the value of an environment variable?

Answer Source

A normal variable is set by simply assigning it a value; note that no whitespace is allowed around the =:


An environment variable is a regular variable that has been marked for export to the environment.

export HOME

You can combine the assignment with the export statement.

export HOME=c
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download