bier hier bier hier - 1 month ago 5x
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?


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