show more git info on zsh prompt

[ link: zsh-git-prompt | tags: git zsh shell | updated: Sun, 03 Oct 2010 10:32:00 ]

UPDATE: This post was updated (yet again).

This is my third post on the topic. I have harshly assimulated MadCoder's configuration. Here is my new zsh prompt:

zsh git prompt

UPDATE: I've updated my prompt again.

I have decided to move the user name, host, and full path to the right of the screen, since most of the time I know those (if you don't use zsh: the right prompt vanishes if the command line is long so to not get in the way of editing, it also goes away after you execute the command). On the left, I now show the git state (see below) and the last component of the $PWD.

The git bits include:

  • the name of the current branch;
  • the current state of:
    • git rebase,
    • git merge,
    • git am and
    • git bisect;
  • also on the right prompt I highlight (in yellow) the parts of the path that are subdirs of the repository.

And here are my config files:

If you want more info read the previous posts, or email...

UPDATE: since I originally wrote this, and the previous articles on the topic, several new techniques have been written and some have many cool new features. I recommend checking out this writeup. However, the alternatives seem to be non-caching and thus take a ong time to refresh the prompts on large repositories. As a result, they are not very interesting to me since I tend to work on large projects where calling git status could take a few seconds. If you're still interested in a fast prompt read on...

Bart's Blog



I am a Linux driver, kernel, and embedded software developer, currently working for Diablo Technologies Inc.

RSS Feed - Full Content

RSS Feed - Full Content

ipv6 ready

Valid XHTML 1.0 Transitional

Created with Vim

Created with Perl


boot busybox debian desktop disk dns git hw ipv6 irc linux lvm mmc nfs pxe screen script shell ssd ssh usb weechat wind x xfs zsh


[ 20130409092758 ]
automount mmcblk devices

[ 20130316190507 ]
tunnelbroker vs IRC

[ 20110616180255 ]

[ 20110517204617 ]
how to manually create a 6in4 tunnel

[ 20110501202915 ]
Presentation slides published!

[ 20110320190458 ]
What is IPv6, and why should I care?

[ 20110309230106 ]
Ottawa IPv6 Summit 2011

[ 20110309225149 ]
I am now an IPv6 Sage

[ 20101214145558 ]
It's a Holiday Miracle

[ 20101103095130 ]
ipv6 on your desktop in 2 steps

[ 20101020113026 ]
growing a live LVM volume

[ 20100915175649 ]
distributing DNS list through radvd

[ 20100225104049 ]
pimped out zsh prompt

[ 20081011081638 ]
creating busybox symlinks

[ 20080509111534 ]
show more git info on zsh prompt

[ 20080404105620 ]
show current git branch on zsh prompt (2)

[ 20080105132854 ]
WeeChat spell suggestions

[ 20071219221358 ]
show current git branch in zsh

[ 20070811105746 ]
forwarding ssh and X through screen

[ 20070316092236 ]
pxeboot and nfsroot with debian

Bart Trojanowski