arrow_back Back to Notebook
linux/fish_terminal
linux/fish_terminal
February 17, 2019

How to show the git branch in Fish

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

Thanks for reading!

John Wiseman

Full-Stack Software Engineer building scalable digital solutions. specializing in modern web technologies and mission-critical systems.

© 2026 Wiseman Systems Pty. Ltd.

Navigation

Start a Conversation

Ready to discuss your next project? Let's build something extraordinary together.

Get in Touch