Alter Git prompt on Windows

Posted by kko on Stack Overflow See other posts from Stack Overflow or by kko
Published on 2012-04-12T23:16:40Z Indexed on 2012/04/12 23:29 UTC
Read the original article Hit count: 170

Filed under:
|
|
|
|

I'm using Git on Windows, installed through GitExtensions with MSysGit (latest) having selected "do not modify my Windows prompt" during installation.

Now, I would like to be able to modify the default prompt (which by default shows just the branch name to also show me how much time, and how many local commits since I last pushed to origin (or specifically origin/master, whichever is easier).

So say instead of: me@myPC /c/myRepo (master)

I would see something along the lines of: me@myPC /c/myRepo (master) 5 | 10:20

meaning I have last pushed 10h 20min ago and I have made 5 local commits since.

Before you mention it, I am aware there are ways of doing it with PowerShell, but I don't want to use it. I want my standard git bash we all know and love.

I found a few solutions to that, with modifying PS1 variable in .bashrc file, but (excuse my poor Unix konwledge) they seem to be not working, (for example accepted answer to this question).

So there you have it. Is this possible?

© Stack Overflow or respective owner

Related posts about Windows

Related posts about git