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

/zsh-git-prompt

About

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




Tags

boot busybox debian debug desktop devel disk dns git grub hw ipv6 ipv6summit.ca irc linux lvm mmc mp3 music nfs pxe scm screen script shell ssd ssh svn ubuntu usb weechat wind x xfs zsh

Posts

[ 20130409092758 ]
automount mmcblk devices

[ 20130316190507 ]
tunnelbroker vs IRC

[ 20110616180255 ]
HDD -> SDD

[ 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

[ 20100908173402 ]
Canadian ipv6 drought

[ 20100903190623 ]
ipv6 certification

[ 20100723192259 ]
m4a to mp3

[ 20100723134522 ]
git 1.7.2 is out

[ 20100523092001 ]
console=ttyS0 with grub2

[ 20100426162644 ]
How many times is my function used within an executable?

[ 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)

[ 20080303200359 ]
how to track multiple svn branches in git

[ 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
http://www.jukie.net/~bart
bart@jukie.net