Added git aliases

This commit is contained in:
gpkvt 2023-07-17 06:16:30 +02:00
parent 2f45eb5927
commit b9cdbf8cbd
1 changed files with 32 additions and 0 deletions

View File

@ -77,6 +77,38 @@ alias drun=drun-fn
alias dsp="docker system prune --all"
alias dsr=dsr-fn
function current_branch() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo ${ref#refs/heads/}
}
function current_repository() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo $(git remote -v | cut -d':' -f 2)
}
alias g='git'
alias gst='git status'
alias gup='git fetch && git rebase'
alias gc='git commit -a -v'
alias gco='git checkout'
alias gcm='git checkout master'
alias gb='git branch'
alias gba='git branch -a'
alias gcount='git shortlog -sn'
alias gcp='git cherry-pick'
alias glg='git log --stat --max-count=5'
alias glgg='git log --graph --max-count=5'
alias gss='git status -s'
alias ga='git add -A'
alias gm='git merge'
alias grh='git reset HEAD'
alias grhh='git reset HEAD --hard'
alias gl='git pull origin $(current_branch)'
alias gp='git push origin $(current_branch)'
alias gpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
alias ls='ls --color=never'
alias ll='ls -lah --color=never'
alias grep='grep --color=auto'