Skip to content

Commit

Permalink
[git] Add some aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrgn committed Nov 21, 2017
1 parent 02fdbc8 commit 54f4453
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .bashrc.local
Expand Up @@ -66,13 +66,22 @@ function clone() { git clone git@github.com:${1}.git; }
function aur-clone() { git clone ssh://aur@aur.archlinux.org/${1}.git; }

# Git shortcuts
alias gits="git status" && __git_complete gits _git_status
alias gita="git add" && __git_complete gita _git_add
alias gitc="git commit" && __git_complete gitc _git_commit
alias gitco="git checkout" && __git_complete gitco _git_checkout
alias gitd="git diff" && __git_complete gitd _git_diff
alias gitp="git pull" && __git_complete gitp _git_pull
alias gitl="git log" && __git_complete gitl _git_log
alias g="git"
__git_complete g _git
alias gits="git status"
__git_complete gits _git_status
alias gita="git add"
__git_complete gita _git_add
alias gitc="git commit"
__git_complete gitc _git_commit
alias gitco="git checkout"
__git_complete gitco _git_checkout
alias gitd="git diff"
__git_complete gitd _git_diff
alias gitp="git pull"
__git_complete gitp _git_pull
alias gitl="git log"
__git_complete gitl _git_log
alias gitvim="vim -p \$(git status --short | awk '\$1 ~ /^M$/ {print \$2}')"
function git_is_merged() {
revlist=$(git rev-list -1 $1 --not $2)
Expand Down
13 changes: 13 additions & 0 deletions .gitconfig
Expand Up @@ -9,7 +9,20 @@
lg = log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr %an)%Creset' --abbrev-commit --date=relative
wdiff = diff --color-words
safemerge = merge --ff-only
unstage = reset HEAD --
git = !cd "$GIT_PREFIX" && git
s = status
c = commit
d = diff
a = add
m = merge
sm = merge --ff-only
pu = push
pl = pull
co = checkout
[pager]
color = true
[push]
default = simple
[rebase]
autosquash = true

0 comments on commit 54f4453

Please sign in to comment.