Skip to content

Instantly share code, notes, and snippets.

@SujitSingh
Last active September 13, 2022 13:39
Show Gist options
  • Save SujitSingh/84a28ef147ca12315afca8b17b6f23cb to your computer and use it in GitHub Desktop.
Save SujitSingh/84a28ef147ca12315afca8b17b6f23cb to your computer and use it in GitHub Desktop.
Change Ubuntu's terminal to look like Git-bash of Window

Change Ubuntu's terminal to look like Git-bash of Window

Add these code in the .bashrc file present in Home folder. Find it using ~/.bashrc/ command.

# git branch info if present
parse_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\033[36m\]\u@\h\[\033[00m\] \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] \n\[\033[1;31m\]>>\[\033[00m\] "

# Another style
# export PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\] @ \[\033[0;36m\]\h \w\[\033[0;32m\]$(__git_ps1)\n\[\033[0;32m\]└─\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\] ▶\[\033[0m\] '

Ubuntu's terminal screenshot -

enter image description here

VS code's terminal screenshot -

enter image description here

Answer for this solution along with original page providing this solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment