Created
November 4, 2021 20:27
-
-
Save filipedfs/d2399847cc27037ac7746d05877e92a6 to your computer and use it in GitHub Desktop.
Show git branch on terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Add this code to .bashrc or .bash_profile file on ~/ | |
| # \u: usuário atual | |
| # \h: nome da máquina (host) | |
| # \H: nome da máquina completo | |
| # \w: diretório de trabalho atual | |
| # \W: diretório de trabalho atual com o nome base (último segmento) apenas | |
| # $(__git_ps1 "%s"): branch atual caso esteja em um repositório git, senão exibe nada. | |
| # azul: \[\033[0;34m\] | |
| # vermelho: \[\033[0;31m\] | |
| # vermelho fluorescente: \[\033[1;31m\] | |
| # verde: \[\033[0;32m\] | |
| # verde fluorescente: \[\033[1;32m\] | |
| # branco forte: \[\033[1;37m\] | |
| # cinza: \[\033[0;37m\] | |
| # padrão: \[\033[0m\] | |
| export PS1='\u@\h\[\033[01;34m\] \w\[\033[0;32m\]$(__git_ps1 " (%s)")\[\033[01;34m\]$\[\033[00m\] ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment