Skip to content

Instantly share code, notes, and snippets.

@romanitalian
Forked from Zveroboev/.bash_profile
Last active March 23, 2018 08:38
Show Gist options
  • Save romanitalian/25232443d33d9b4b6fb0d25db48bedad to your computer and use it in GitHub Desktop.
Save romanitalian/25232443d33d9b4b6fb0d25db48bedad to your computer and use it in GitHub Desktop.
Подсветка текущей git ветки при подключении через ssh + показывает текущее время в каждом запросе
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export GOPATH=/home/romadin/golang
export PATH="$PATH:$GOPATH/bin"
BASH_ENV=$HOME/.bashrc
export BASH_ENV
function git-branch-name {
git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3
}
function git-branch-prompt {
local branch=`git-branch-name`
if [ $branch ]; then printf " [%s]" $branch; fi
}
RED="\[\033[0;31m\]"
GREEN="\[\033[0;32m\]"
YELLOW="\[\033[0;33m\]"
BLUE="\[\033[0;34m\]"
CYAN="\[\033[0;36m\]"
PURPLE="\[\033[0;35m\]"
WHITE="\[\033[0;37m\]"
NO_COLOR="\[\033[0m\]"
# PS1=" $NO_COLOR\u@\h \$YELLOW_PROMPT\$(date +%H:%M:%S) $PURPLE\W\[\033[0m\] $GREEN\$(git-branch-prompt)\[\033[0m\] \$ $CYAN"
PS1="$YELLOW\$(date +%H:%M:%S) $PURPLE\W\[\033[0m\] $GREEN\$(git-branch-prompt)\[\033[0m\] \$ $CYAN"
# 11:37:48 my_project [master] $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment