forked from framallo/gh-dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbash_git
More file actions
executable file
·36 lines (29 loc) · 712 Bytes
/
bash_git
File metadata and controls
executable file
·36 lines (29 loc) · 712 Bytes
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
function parse_git_dirty {
git diff --quiet HEAD &>/dev/null
if [ $? != 1 ]
then
echo "$"
else
echo "⚡"
fi
}
if [ -n __git_ps1 ]; then
function parse_git_branch {
local branch=$(__git_ps1 "%s")
[[ $branch ]] && echo "⭠ $branch"
}
fi
source ~/.gh-dotfiles/bash_git_completion
alias g='git'
alias gs='git status'
alias gc='git commit'
alias gca='git commit -a'
alias ga='git add'
alias gco='git checkout '
alias gb='git branch'
alias gm='git merge'
alias gd="git diff"
alias gg="git grep --color -n"
alias ggi="git grep -ni"
complete -o default -o nospace -F _git_branch gb
complete -o default -o nospace -F _git_checkout gco