forked from bjeanes/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgitaliases
executable file
·55 lines (43 loc) · 1.26 KB
/
gitaliases
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
# Dr Nic Compatibility Mode
alias g='git'
alias gl='git pull --rebase --autostash'
alias gap='git add -p'
alias gcp='git checkout -p'
alias gc='git commit -v'
alias gco='git checkout'
alias grh='git reset HEAD'
alias grc='git rebase --continue'
alias grs='git rebase --skip'
alias gra='git rebase --abort'
alias sha='git rev-parse HEAD | tr -d '\n' | pbcopy'
alias cherry='git cherry-pick $1'
alias gcane='git commit --amend --no-edit'
alias good='git bisect good'
alias bad='git bisect bad'
function gr() {
local branch="${1:-master}"
git rebase $branch
}
function push() {
git push origin `git current-branch`
}
function pull() {
git pull --rebase origin `git current-branch`
}
function rb() {
git rebase -i HEAD~$1 -p --autostash
}
function pt() {
`git push origin ${*:1}`
}
fbr() {
local branches branch
branches=$(git for-each-ref --count=30 --sort=-committerdate refs/heads/ --format="%(refname:short)") &&
branch=$(echo "$branches" |
fzf-tmux -d $(( 2 + $(wc -l <<< "$branches") )) +m) &&
git checkout $(echo "$branch" | sed "s/.* //" | sed "s#remotes/[^/]*/##")
}
alias pap='gl && push'
alias gitrm="git status | grep deleted | awk '{print $3}' | xargs git rm"
export PATH=/usr/local/git/bin:$PATH
export MANPATH=/usr/local/git/man:$MANPATH