LoginSignup
1
0

More than 5 years have passed since last update.

macOSでgitprompt.shを使ってコマンドプロンプトを良い感じに設定する

Last updated at Posted at 2018-01-30

https://github.com/magicmonty/bash-git-prompt#installation
ここにある通りなんだけど
* brewbash-git-promptを入れる
* ~/.bash_profileでプロンプトを設定する
の2行程

brewでbash-git-promptを入れる

ついでに bash completion も追加しておく

cli
brew update
brew install bash-git-prompt bash-completion

~/.bash_profileでプロンプトを設定する

~/.bash_profile
if [[ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]]; then
  __GIT_PROMPT_DIR=$(brew --prefix)/opt/bash-git-prompt/share
  source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh"
fi

[[ -f $(brew --prefix)/etc/bash_completion ]] && . $(brew --prefix)/etc/bash_completion
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0