How to add /usr/local/bin in $PATH on Mac How to add /usr/local/bin in $PATH on Mac git git

How to add /usr/local/bin in $PATH on Mac


This works in either bash (which is the default shell pre-Catalina) or zsh (which is the default shell from Catalina onward):

export PATH=$PATH:/usr/local/git/bin:/usr/local/bin

In zsh you can also do this for the same result:

path+=(/usr/local/git/bin /usr/local/bin) 


Try placing $PATH at the end.

export PATH=/usr/local/git/bin:/usr/local/bin:$PATH


To make the edited value of path persists in the next sessions

cd ~/touch .bash_profileopen .bash_profile

That will open the .bash_profile in editor, write inside the following after adding what you want to the path separating each value by column.

export PATH=$PATH:/usr/local/git/bin:/usr/local/bin:

Save, exit, restart your terminal and enjoy