Bash only reads scripts by default in your home directory, or if they are missing in /etc
. See Bash's documentation. If using OSX's Terminal.app then by default it reads ~/.bash_profile
.
This is true of all bash on Linux or other OSes.
To read from another directory e.g. /opt/local/etc/bash_completion.d
you have to edit your start up files to source (i.e. include) the files from there
The instructions for the script do not mention /opt/local/...
which is a non standard location on any Unix. (by non-standard it is allowed to be used by third party packages but not defined what should be in there) They say
- Copy this file to somewhere (e.g.
~/.git-completion.sh
).
Add the following line to your .bashrc
/.zshrc
:
source ~/.git-completion.sh
- Consider changing your PS1 to also show the current branch,
see
git-prompt.sh
for details.
The progit quote assumes you know bash. All it is saying is put the files from the first quote into a specific place if you want all users on the machine to use them and not in ~
where only the user installing it can see them. i.e. the point is multi user versus single user.
He also picks that path as nothing else uses it and you should not edit /etc
files in OS X as Apple's OS upgrades could overwrite them so you need to choose another place. (I would have chosen something under /usr/local
as there is where manually maintained scripts are meant to go).
~/.bashrc
is the correct place to edit and add the source. See your other question and the bash manual for setting up ~/.bash_profile
The bash suggested way is source .bashrc
into .bash_profile
. Note that on OS X using Terminal.app is not the one way of running shells so there can be sessions starting with .bashrc
.
If you use Homebrew it's pretty easy:
brew upgrade git
which git
=> /usr/local/bin/git
git --version
=> git version 2.7.3
Done.
Best Answer
Didn't tested, but the Source Tree configuration files are on the following path:
Coping the directory to your new computer should be enough to recover your settings.