Hacker News new | past | comments | ask | show | jobs | submit login

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




It definitely can tell you whether you have staged files, because I use it for that among other things. I don't remember how I turned that feature on, but it wasn't hard. Perhaps someone will chime in with the details.


Just add the following lines in your .bashrc:

    export GIT_PS1_SHOWDIRTYSTATE=yes
    export GIT_PS1_SHOWUNTRACKEDFILES=yes


Thanks. I didn't know about those. I've configured them in my ~/.bashrc now: http://github.com/avar/dotfiles/commit/43454870




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: