-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_aliases
60 lines (58 loc) · 1.68 KB
/
.bash_aliases
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
alias c=clear
alias o='xdg-open'
# ----------------------
# Git Aliases
# ----------------------
# From: https://jonsuh.com/blog/git-command-line-shortcuts/
alias ga='git add'
alias gaa='git add .'
alias gaaa='git add --all'
alias gau='git add --update'
alias gaup='git add --update -p'
alias gb='git branch'
alias gbd='git branch --delete '
alias gc='git commit'
alias gcm='git commit --message'
alias gcf='git commit --fixup'
alias gco='git checkout'
alias gcob='git checkout -b'
alias gcom='git checkout master'
alias gcos='git checkout staging'
alias gcod='git checkout develop'
alias gd='git diff'
alias gda='git diff HEAD'
alias gi='git init'
alias glg='git log --graph --oneline --decorate --all'
alias gld='git log --pretty=format:"%h %ad %s" --date=short --all'
alias gm='git merge --no-ff'
alias gma='git merge --abort'
alias gmc='git merge --continue'
alias gp='git pull'
alias gpr='git pull --rebase'
alias gr='git rebase'
alias gs='git status'
alias gss='git status --short'
alias gst='git stash'
alias gsta='git stash apply'
alias gstd='git stash drop'
alias gstl='git stash list'
alias gstp='git stash pop'
alias gsts='git stash save'
alias gcp='git cherry-pick'
alias gr='git remote'
alias grp='git remote prune'
alias grh='git reset HEAD'
alias gpuoh='git push -u origin HEAD'
# setup autocompletion
# https://stackoverflow.com/a/52169814/7657658
if [ -f "/usr/share/bash-completion/completions/git" ]; then
source /usr/share/bash-completion/completions/git
__git_complete gc _git_commit
__git_complete gco _git_checkout
__git_complete gp _git_pull
__git_complete gb _git_branch
__git_complete gcp _git_cherry_pick
__git_complete gr _git_remote
else
echo "Error loading git completions"
fi