Extend $PATH variable in git bash under Windows

后端 未结 3 857
说谎
说谎 2021-02-05 06:33

I\'m trying to extend my $PATH variable in git bash (MinGW shell) by adding the following to the file ~/.bashrc

PATH=$PATH\':/c/Program Files/maven/apache-maven-         


        
3条回答
  •  一向
    一向 (楼主)
    2021-02-05 07:00

    I needed to add something to my Git Bash path permanently each time I open it. It was Meld.exe path which can be added with:

    export PATH=$PATH:"/C/Program Files (x86)/Meld/lib"
    

    In order to execute this command each bash session, you need a ~/.bashrc file. Check if it already exists or create it using notepad ~/.bashrc or touch ~/.bashrc.

    You can check where it is with:

    echo ~
    

    Open it and add the command that adds the PATH (first command in this response).

    I hope you found this useful.

提交回复
热议问题