How to customize Git Bash Shell prompt settings
Customize Git Bash Shell config
By default, the Git Bash Shell displays computer name and username properties in the prompt window. Understandably, some users prefer to change these Git Bash Shell settings. Fortunately, it’s not that difficult to do.
Steps to customize Git Bash style
Follow these steps to customize the username, computer name, title and colors of the Git Bash Shell prompt:
- Locate the Git installation folder on your computer.
- Make a backup of the git-prompt.sh file in Git’s etc\profile.d subfolder.
- With administrator rights, edit the properties in the file named PS1.
- Save the git-prompt.sh file.
- Open a new Git Bash Shell prompt to see the customized properties display.
Edited git-prompt.sh settings example
Here is a snippet from the git-prompt.sh file that changes the Git Bash Shell’s hostname, username and title:
PS1='\[\033]0;New Git Bash Title:$PWD\007\]' # change Git Bash window title PS1="$PS1"'\n' # new line PS1="$PS1"'\[\033[32m\]' # change Git Bash prompt color to green PS1="$PS1"'New Git Bash Username & Hostname ' # Change Git Bash shere user@host<space> setting PS1="$PS1"'\[\033[35m\]' # change Git Bash shell color to purple PS1="$PS1"'Not Ming32 ' # change Git Bash shell MING64 display PS1="$PS1"'\[\033[33m\]' # change Git Bash Prompt color to brownish yellow PS1="$PS1"'\w' # Display Git Bash prompt'scurrent working directory
Updated Git Bash Shell configuration
When you save these changes, all new Git Bash Shell prompts that are opened will display the updated settings.