2023-08-18 (Linux用) gitのbranchの情報をプロンプトに出す方法メモ git-prompt.shをダウンロード wget https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh .bashrcを編集する PS1を設定している箇所を変更。最後の\$の前に$(__git_ps1 " (%s)")を入れる PS1='${debian_chroot:+($debian_chroot)}[\033[01;32m]\u@\h[\033[00m]:[\033[01;34m]\w[\033[00m]$(__git_ps1 " (%s)")\$ ' ※debian 10での設定 末尾にダウンロードしたgit-prompt.shの読み込みを追加(PS1の設定の後でも動作するらしい) source /path/to/git-prompt.sh これでOKのはず 参考サイト: git :: bash プロンプトにブランチ名と作業ツリーの状態を表示する [Tipsというかメモ]