-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path06_git
More file actions
executable file
·93 lines (80 loc) · 2.09 KB
/
06_git
File metadata and controls
executable file
·93 lines (80 loc) · 2.09 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# source ~/.git_auto_complete.sh
if [[ -x `which git` ]]; then
function git-branch-name () {
git branch 2> /dev/null | grep ^\* | sed s/^\*\ //
}
function git-dirty () {
git status | grep "nothing to commit (working directory clean)"
echo $?
}
function gsrb () {
branch=$(git-branch-name)
git checkout master
git svn rebase
git checkout "${branch}"
git rebase master
}
function gmrb () {
branch=$(git-branch-name)
git checkout master
git pull origin master
git checkout "${branch}"
git rebase master
}
function gsu () {
git checkout master
git svn rebase
}
function git-prompt() {
branch=$(git-branch-name)
if [[ x$branch != x ]]; then
dirty_color=$fg[green]
if [[ $(git-dirty) = 1 ]] { dirty_color=$fg[red] }
[ x$branch != x ] && echo " %{$dirty_color%}$branch $(git-stash-count)%{$reset_color%} "
fi
}
function git-stash-count() {
branch=$(git-branch-name)
count=$(git stash list | grep "${branch}" | wc -l | awk '{print $1}')
[ $count != 0 ] && echo "($count)"
}
function gtag () {
git tag -a -m "Tagging Version ${1}" $1
git push origin master
git push --tags
}
fi
# Logging
alias gfame='git log | git shortlog -n -s'
alias gfame2="ruby /Scripts/gscore.rb"
alias glog="git log --pretty=oneline"
alias glog_ss="git log --shortstat"
alias glog_ns="git log --name-stat"
alias glog_p="git log -p"
alias glog_s="git log --pretty=short"
# Rebasing
alias grc='git rebase --continue'
alias grs='git rebase --skip'
alias gra='git rebase --abort'
# Diff
alias gd='git diff'
alias gdm='git diff | mate'
# Unorganized
alias gst='git status'
alias gl='git pull'
alias gp='git push'
alias gr='git remote'
alias ga='git add -i'
alias gco='git checkout'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gspp='git stash pop'
alias gb='git branch'
alias gba='git branch -a'
# Svn Helpers
alias gsp="git svn dcommit"
# Utilitarian
alias grmut='git ls-files -o --exclude-from=.gitignore | xargs rm'
alias gits="ls /opt/local/bin/ | grep git"
alias gh="github"
alias grb_gh="open http://github.com/webmat/git_remote_branch/tree/master"