-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbash_profile
54 lines (44 loc) · 1.09 KB
/
bash_profile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
git_dirty_indicator()
{
git_status=$(git status --porcelain 2> /dev/null)
[ $? -ne 0 ] && return
if [ -z "$git_status" ]
then
echo "\[\e[1;32m\]●\[\e[m\] "
else
echo "\[\e[1;31m\]●\[\e[m\] "
fi
}
git_branch()
{
git_branch2=$(git rev-parse --abbrev-ref HEAD 2> /dev/null)
[ $? -ne 0 ] && return
echo "\[\e[0;34m\]$git_branch2\[\e[m\] "
}
bash_prompt()
{
ruby_version="\[\e[0;35m\]$(ruby --version | awk '{print $2}')\[\e[m\]"
arrow="\[\e[0;33m\]»\[\e[m\]"
path="\[\e[0;32m\]\w\[\e[m\]"
if [ -n "$SSH_CLIENT" ]; then
host="\[\e[0;35m\]\h:\[\e[m\] "
fi
PS1="$host$(git_dirty_indicator)$(git_branch)$path $arrow "
}
PROMPT_COMMAND=bash_prompt
alias v='vim'
alias gi='git'
ailas gb='git branch'
alias gd='git diff'
alias gdc='git diff cached'
alias gri='git rebase -i'
alias go='git checkout'
alias gob='git checkout -b'
alias gs='git status'
alias gst='git stash'
alias gc='git commit'
alias ga='git add'
alias gl='git log'
alias gprune='git fetch --prune && git branch --merged | grep -v "*" | xargs -n 1 git branch -d'
export PGHOST=localhost
source ~/.bashrc