Skip to content

Instantly share code, notes, and snippets.

@felipebizz
Last active April 13, 2022 17:43
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save felipebizz/194e967c2ef7a9865298 to your computer and use it in GitHub Desktop.
Save felipebizz/194e967c2ef7a9865298 to your computer and use it in GitHub Desktop.
Mostrar branch atual no terminal
#Adicionar no fim do arquivo /home/{user}/.bashrc
#variavel do terminal
export PS1="\[\033[38m\]\u\[\033[32m\] \w \[\033[31m\]\`git \\
branch 2>/dev/null | grep \"^\*\" | \\
sed -r \"s/\*\ (.*)/ \(\1\)/\"\`\[\033[37m\]$\[\033[00m\] "
#Agora, rode o comando source ~/.bashrc para recarregar e ver a alteração sem precisar reiniciar o terminal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment