Add more git aliases

This commit is contained in:
ItsDrike 2021-12-01 19:58:56 +01:00
parent bb7a2af9f9
commit b267b97c45
No known key found for this signature in database
GPG key ID: FB8CA11A2CF3A843
2 changed files with 72 additions and 29 deletions

View file

@ -1,25 +1,72 @@
# This is Git's per-user configuration file.
[user] [user]
name = ItsDrike name = ItsDrike
email = itsdrike@protonmail.com email = itsdrike@protonmail.com
signingkey = FB8CA11A2CF3A843 signingkey = FB8CA11A2CF3A843
[credential]
helper = store --file ~/.config/git/git-credentials
[alias] [alias]
m = "merge"
p = "push"
pl = "pull"
f = "fetch"
s = "status --short --branch"
ss = "status"
ch = "checkout"
chb = "checkout -b"
undo = "reset --soft HEAD~"
redo = "reset HEAD@{1}"
unstage = "restore --staged"
c = "commit"
ca = "commit --ammend"
ci = "commit --interactive"
cm = "commit --message"
cv = "commit --verbose"
a = "add"
aa = "add --all"
ap = "add --patch"
au = "add --update"
d = "diff"
dc = "diff --cached"
ds = "diff --staged"
dw = "diff --word-diff"
b = "branch"
ba = "branch --all"
bd = "branch --delete"
bD = "branch --delete --force"
bm = "branch --move"
bM = "branch --move --force"
l = "log --oneline --decorate --all --graph" l = "log --oneline --decorate --all --graph"
lol = "log --pretty=oneline --abbrev-commit --graph" lp = "log --patch"
lo = "log --pretty=oneline --abbrev-commit --graph"
lg = "log --all --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --" lg = "log --all --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
set-upstream = "!git branch --set-upstream-to=origin`git symbolic-ref --short HEAD`"
find-merge = "!sh -c 'commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'" find-merge = "!sh -c 'commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'"
show-merge = "!sh -c 'merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge'" show-merge = "!sh -c 'merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge'"
[credential]
helper = store --file ~/.config/git/git-credentials
[core]
excludefile = ~/.config/git/global_gitignore
editor = vim
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
line-numbers = true
[merge] [merge]
tool = meld conflictstyle = diff3
[mergetool]
keepbackup = false
keeptemporaries = false
[diff] [diff]
tool = meld tool = vimdiff
[fetch]
prune = true
[commit] [commit]
gpgsign = true gpgsign = true
[gpg] [init]
program = /usr/bin/gpg defaultBranch = main

View file

@ -195,26 +195,22 @@ alias cleanup='clean-trash && clean-down && clean-journal && clean-pacman'
# Git aliases # Git aliases
alias g='git' alias g='git'
alias gs='git status' alias gp='git push'
alias gpl='git pull'
alias gf='git fetch'
alias gs='git status --short --branch'
alias gss='git status'
alias ga='git add'
alias gap='git add --patch'
alias gc='git commit'
alias gcm='git commit --message'
alias gb='git branch'
alias gch='git checkout'
alias gchb='git checkout --branch'
alias gd='git diff' alias gd='git diff'
alias gdc='git diff --cached' alias gdc='git diff --cached'
alias gm='git merge' alias gundo='git reset --soft HEAD~'
alias ga='git add'
alias gaa='git add all'
alias gc='git commit'
alias gcm='git commit -m' && alias commit='git commit -m'
alias gp='git push' && alias push='git push'
alias gpl='git pull' && alias pull='git pull'
alias gf='git fetch' && alias fetch='git fetch'
alias gb='git branch' && alias branch='git branch'
alias gch='git checkout' && alias checkout='git checkout'
alias gau='git add -u' && alias addup='git add -u'
alias gchb='git checkout -b'
alias gcda='git diff --cached' # Diff any files staged for commit
alias glog='git log --oneline --decorate --graph'
alias gundo='git reset HEAD~'
alias gredo="git reset 'HEAD@{1}'" alias gredo="git reset 'HEAD@{1}'"
alias gundopush="git push -f origin HEAD^:master"
# Youtube-dl aliases # Youtube-dl aliases
alias ytv-best='youtube-dl -f bestvideo+bestaudio' alias ytv-best='youtube-dl -f bestvideo+bestaudio'