All OS either on windows and linuxs has there desired user. You can set the profile and bash settings from a file named as ~/.bashrc or ~/.profile.
If you have installed BASH on your windows machine using WSL and want to beautify your git terminal you need to update the ~/.bashrc
Download the git prompt script in home path.
curl -o ~/.git-prompt.sh https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
Once it get downloaded, Here is the code you need to add in ~/.bashrc
# Git branch in prompt
source ~/.git-prompt.sh # make sure you have file present on this location.
GIT_PS1_SHOWCOLORHINTS=true
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWSTASHSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
GIT_PS1_SHOWUPSTREAM="auto"
# Customize prompt appearance with symbols
PS1='\[\e[32m\]\u@\h \[\e[34m\]\W\[\e[33m\]$(__git_ps1 " (\[\e[31m\]$(git_prompt_symbol dirty)\[\e[33m\]$(git_prompt_symbol staged)\[\e[33m\]$(git_prompt_symbol stash)\[\e[33m\]$(git_prompt_symbol branch)\[\e[33m\]%s)")\[\e[0m\]\$ '
# Define symbols for different Git states
GIT_PROMPT_SYMBOLS=(
[clean]="✓" # Clean working directory
[dirty]="✗" # Dirty working directory
[untracked]="?" # Untracked files
[staged]="+" # Staged changes
[conflicted]="!" # Conflicts
[stash]="⚑" # Stashed changes
[branch]="➜" # Branch symbol
)
# Function to return the appropriate symbol
git_prompt_symbol() {
local state=$1
echo -n "${GIT_PROMPT_SYMBOLS[$state]}"
}
Here: shakeeb is username msh-notebook is computername devops is the directory updating_readme_file is the branchname
shakeeb@msh-notebook devops (➜➜➜ ➜ updating_readme_files *%)$