Git current branch in terminal

Add this in your ~/.bash_profile

source /Library/Developer/CommandLineTools/usr/share/git-core/git-prompt.sh
PS1="\033[32m\][\[\033[32m\]\w]\[\033[93m\]\$(__git_ps1)\n\[\033[1;36m\]\u\[\033[32m\]$ \[\\033[0m\]"
Bash
PS1=" \033[37m\]\u \033[32m\[\033[32m\][\[\033[32m\]\w]\[\033[93m\]\$(__git_ps1)\n\[\033[1;36m\]\[\033[32m\]> \[\\033[0m\]"
Bash

Bash color code

Color Code
Black 0;30
Dark Gray 1;30
Blue 0;34
Light Blue 1;34
Green 0;32
Light Green 1;32
Cyan 0;36
Light Cyan 1;36
Red 0;31
Light Red 1;31
Purple 0;35
Light Purple 1;35
Brown 0;33
Yellow 1;33
Light Gray 0;37
White 1;37

MarquandT

Ethical Hacker ~ Web Developper ~ Hosting Provider ~ Crypto Enthusiast ~ Automation Expert Bitcoin donation: 32Uu4NKGnxSPC7UukYXVyRHwbppbQpKVki

Comments

You must login to send a comment.