DEV Community

loading...
Cover image for Git Bash Customization (on windows)

Git Bash Customization (on windows)

Oryam
Junior Web developer
・2 min read

A simple Costumization tutorial

Turn This :

Alt Text

Into This (or any style):

Alt Text

The easy way

Go to bash settings by simply right-clicking and go to options menu.
There you will find the "Looks" tab.
You can play with the themes and properties to make it look the way you like.

Alt Text

The cool way

Using this method you can change some more things like the window title for example.

  1. go to C:\Program Files\Git\etc\profile.d\
  2. open git-prompt.sh as administartor in your favorite code editor. (I found an easy way, to open Powershell as administrator and then open vscode from there).

Alt Text

In the file this is what you suppose to find:

PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]' # set window title
PS1="$PS1"'\n'                         # new line
PS1="$PS1"'\[\033[32m\]'               # change to green
PS1="$PS1"'\u@\h '                     # user@host<space>
PS1="$PS1"'\[\033[35m\]'               # change to purple
PS1="$PS1"'$MSYSTEM '                  # show MSYSTEM
PS1="$PS1"'\[\033[33m\]'               # change to brownish yellow
PS1="$PS1"'\w'                         # current working directory
Enter fullscreen mode Exit fullscreen mode

The comments talk for themself...

I change it to be :

PS1='\[\033]0;Git-Bash\007\]'  # set window title Git-Bash
PS1="$PS1"'\n'                 # new line
PS1="$PS1"'\[\033[32m\]'       # change to green
PS1="$PS1"'\u -> '             # user -> 
# removed  MSYSTEM
PS1="$PS1"'\[\033[33m\]'       # change to brownish yellow
PS1="$PS1"'\W'                 # current working Folder(not the whole path)
Enter fullscreen mode Exit fullscreen mode

And, That's it!

Discussion (2)

Collapse
belev profile image
Be.Lev

coool, thanks!

Collapse
zdev1official profile image
ZDev1Official

Thank you!