VideosMy ProjectsProgramming BlogGallery
  1. Home
  2. Blog
  3. How to show the git branch in Fish
Programming Blog

Atom/RSS Feed

linux/fish_terminal

How to show the git branch in Fish

linux/fish_terminal

Show the git branch on the end of the terminal prompt is a really useful modification as you can always see the branch you are on!

Add this to your config

function fish_prompt
    set -l git_branch (git branch ^/dev/null | sed -n '/\* /s///p')
    echo -n (c green -o)(whoami)'@'(hostname)(c normal)':'(c blue -o)(prompt_pwd)' '(c red)"$git_branch"(c normal)'$ '
end
Join my mailing list