summaryrefslogtreecommitdiff
path: root/git.zsh
blob: 981219e3af11e379ab36f91588eb9f43ae3f812e (plain)
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
alias gs='git status'
alias gsh='git status ./'
alias gd='git diff'
alias gdc='git diff --cached'
alias gdch='git diff --cached ./'
alias gdh='git diff ./'
alias gac='git add . && git commit'
alias ga='git add'
alias gc='git commit'
alias gpc='git commit -t $GIT_AUTHORS_FILE'
alias gcm='gc -m'
alias gpo='git push origin'
alias gpu='git pull'
alias gp='git push'
alias gr='git reset'
alias grh='git reset --hard'
alias gb='git branch'
alias gch='git checkout'
alias grf='git checkout --'
alias grb='git rebase'
alias patchy='git add -p'
alias stash='git stash'
alias poppy='stash pop'
alias gcat='gc --amend'
alias ok='grb --continue'
alias live='gpo $(active_branch) --force-with-lease'
alias gsch='gch $(g branch --sort=-committerdate | fzy)'
alias changelist='git diff-tree --no-commit-id --name-only -r'
alias glog='v -c "Gclog -100"'
alias scrubby='g clean -fd'
alias grecent='git branch --sort=-committerdate --format="%(committerdate:relative)%09%(refname:short)"'

function gnu () {
  git checkout -b $(echo $@ | kabab)
}

function gblame () {
  v $1 -c Gblame
}

function sblame () {
  v $(need) -c Gblame
}


function active_branch () {
  git rev-parse --abbrev-ref HEAD
}

function grbi () {
  git rebase -i --autosquash master
}