在git bash中设置环境变量 [英] Set an environment variable in git bash
本文介绍了在git bash中设置环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我从Windows gitbash命令行打孔时:
When I punch from the windows gitbash command line:
set $HOME = c
然后做:
echo $HOME
是否未将其设置为c
?如何更改/设置环境变量的值?
It does not set it to c
? 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 =
:
HOME=c
环境变量是已标记为要导出到环境的常规变量.
An environment variable is a regular variable that has been marked for export to the environment.
export HOME
HOME=c
您可以将赋值与export
语句结合使用.
You can combine the assignment with the export
statement.
export HOME=c
这篇关于在git bash中设置环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文