Created
March 29, 2024 14:17
-
-
Save AyresMonteiro/c2a048e9ff051069b745f66ae1aecbfa to your computer and use it in GitHub Desktop.
[Debian] Add it to ~/.bashrc and show current git branch on bash
This file contains 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
# You need to acquire a copy of that script from git source code | |
# then place it in your home dir | |
source ~/git-prompt.sh | |
COMPLETE_CURRENT_DATE="\D{%F %T}" | |
CURRENT_DATE="\D{%T}" | |
YELLOW="\e[33m" | |
BOLD="\e[1m" | |
BOLD_YELLOW="\e[1;33m" | |
BOLD_RED="\e[1;91m" | |
COLOR_END="\e[0m" | |
COLORED_DATE="${BOLD_YELLOW}[${CURRENT_DATE}]${COLOR_END}" | |
COLORED_USER="\[\033[01;32m\]\u\[\033[00m\]" | |
COLORED_DIR="\[\033[01;34m\]\w\[\033[00m\]" | |
COLORED_GIT_BRANCH="${BOLD_YELLOW}\$(__git_ps1)${COLOR_END}" | |
COLORED_INDICATOR="${BOLD}/>${COLOR_END}" | |
BASE_PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}" | |
PS1="${BASE_PS1}${COLORED_USER} ${COLORED_DIR}${COLORED_GIT_BRANCH} ${COLORED_INDICATOR} " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment