You can fix the bash: parse_git_branch: command not found
error by editing your ~/.bash_profile
file and adding the missing semi-colon:
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/ (1)/'; }
Alternatively, you could put the }
on a newline:
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/ (1)/'
}
After you have saved your edits, then you can source your ~/.bash_profile
by running
. ~/.bash_profile
After you have sourced your ~/.bash_profile
, you can confirm the function was sourced properly by running
type parse_git_branch
This should show the function if it was sourced correctly, or display an error if it was not sourced correctly.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…