1

How would I go about installing bash-git-prompt in Git For Windows bash shell?

Docs at https://github.com/magicmonty/bash-git-prompt make mention of ~/.bashrc which I don't have. I've found bash.bashrc in /etc and bash_profile.sh in /etc/profile.d which I suspect might be relevant.

Git bash already has its own git-prompt.sh which it uses to somehow provide its own git prompt, I suspect I have to somehow disable or replace this git prompt implementation with the one from https://github.com/magicmonty/bash-git-prompt, but I have no idea how.

Does anyone know how to do this?

2 Answers 2

1

Step 1:

Find where you install Git, then in directory Git/etc, clone repo bash-git-prompt:

git clone https://github.com/magicmonty/bash-git-prompt.git

Step 2:

Open file bash.bashrc (in directory Git/etc) using any editor, comment out all the code, add only three lines:

GIT_PROMPT_ONLY_IN_REPO=1
GIT_PROMPT_THEME=Evermeet  # you can choose any theme you like, just select one in Git\etc\.bash-git-prompt\themes 
source /etc/.bash-git-prompt/gitprompt.sh

Save file, reopen your git bash window, Voila! It's all done~

Problem:

If you find that the symbol in your bash window fails to display, you can solve it by:

right click on the title bar -> Options -> Text -> Font Select -> DejaVu Sans Mono

RefStrange character

The font limitation shows up in the default Ubuntu shell on Windows 10 as well but I was able to see the glyph characters by simply using DejaVu Mono https://dejavu-fonts.github.io/. What @scotlynhatt means is download the font on windows, install it and then select it from the font menu for the WSL window (right click on the title bar -> properties -> font).

Sign up to request clarification or add additional context in comments.

Comments

0

Just make your own .bashrc

touch ~/.bashrc

Then go and edit with your favourite editor.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.