0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【git】terminalにbranch名を常に表示する設定

Posted at

背景

git使ってると自分が今どのbranhにいるんだっけ?っと良くなる。

たまにdevelopで開発してたと思ったら、masterのままだったとか良くある。

branch名をterminalに表示しておけば間違えないよって言われた。

よくそんな事知ってるな~

設定

gedit ~/.bashrc

以下のおまじないを加える

GIT_PS1_SHOWDIRTYSTATE=true
export PS1='\[\033[32m\]\u@\h\[\033[00m\]:\[\033[34m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\n\$ '

source ~/.bashrc

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?