Live data from Hacker News

Git info in your ZSH Prompt

briancarper.net

1–10 of 27 posts

Re: Git info in your ZSH Prompt

#7
post #6

Note also that there's a more feature complete version that accomplishes the same tasks in the contrib directory of git ( http://git.kernel.org/?p=git/git.git;a=blob;f=contrib/comple... ). It's implemented in bash but I use it with almost no modification with the Korn shell.

You linked to the wrong version, given the topic of this thread.

Recently ZSH support has been added to git-completion.bash, but it's still only in the "next" branch of git: http://git.kernel.org/?p=git/git.git;a=blob_plain;f=contrib/...

Re: Git info in your ZSH Prompt

#9
You can also use Git's own __git_ps1 from git-completion.bash in either bash or in zsh (see my other comment). Here's an example of it in use: http://github.com/avar/dotfiles/blob/master/.bashrc#L86

It doesn't give you info about whether you have staged files (but maybe it should). But it gives you a bunch of other neat stuff, like whether you're in a git-rebase or git-am operation

Post reply on HN