Git Bash how to show repo file information like in Git Shell

I am working with Git Bash on Windows. But I used to work with Git Shell (from github). Git Shell was this awesome thing, see image below:

enter image description here

In Git Shell, I don’t need to use git status to find out how many raw, modified or deleted files I had. Git Shell shows this information after any command.

How to do it for Git Bash (on Windows)?

+4
source share
1 answer

You can just manipulate the PS1 variable, something like this might help you:

 $ PS1="$PS1 [`git diff --shortstat`]> " 

The result should be something like this:

 rlegendi@localhost /.../gitrepo (master) [ 1 file changed, 3 insertions(+)] > 

So basically you should add this as in your profile file (either in the Git installation directory, usually under c:\Program Files (x86)\Git\etc , or in your home directory). This way you can create a more enjoyable version.

Take a look at PROMPT_COMMAND and various git diff switches (e.g. --numstat , etc.).

+1
source

Source: https://habr.com/ru/post/1439520/


All Articles