LoginSignup
7
5

More than 5 years have passed since last update.

macでターミナルにgithubのブランチ名を表示させる

Last updated at Posted at 2017-10-10

どのブランチで作業しているかすぐわかるようにする。

ターミナルにgitブランチ名を表示させる

git-completion.bashのインストール

homebrewでgitをインストールした場合はすでにファイルが存在するはずなので
ファイルがあるかどうか検索する
$mdfind git-completion.bash

ファイルが存在した場合
.bashrcに
source /git-completion.bashがあるパス/git-completion.bash
を記述することでブランチ名が表示される。

ファイルが存在しない場合
DLしたgit-completion.bashをgitがあるフォルダに配置
/usr/local/Cellar/git/1.X.X.X/etc/bash_completion.d/あたり

インストール後は下記のURLを参考に

ブランチ名に色をつけたりできて便利

7
5
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
7
5