remove unused or repeated git aliases
This commit is contained in:
@@ -7,54 +7,30 @@
|
|||||||
[init]
|
[init]
|
||||||
templatedir = ~/.dotfiles/git/templates
|
templatedir = ~/.dotfiles/git/templates
|
||||||
[alias]
|
[alias]
|
||||||
# meta
|
|
||||||
# list all aliases
|
# list all aliases
|
||||||
la = "!git config -l | grep alias | cut -c 7-"
|
la = "!git config -l | grep alias | cut -c 7-"
|
||||||
delete-merged-branches = "!f() { git checkout --quiet master && git branch --merged | grep --invert-match '\\*' | xargs -n 1 git branch --delete; git checkout --quiet @{-1}; }; f"
|
delete-merged-branches = "!f() { git checkout --quiet master && git branch --merged | grep --invert-match '\\*' | xargs -n 1 git branch --delete; git checkout --quiet @{-1}; }; f"
|
||||||
diff = diff --ignore-space-at-eol -b -w --ignore-blank-lines
|
diff = diff --ignore-space-at-eol -b -w --ignore-blank-lines
|
||||||
cnv = commit --no-verify
|
cnv = commit --no-verify
|
||||||
co = checkout
|
co = checkout
|
||||||
|
cob = checkout -b
|
||||||
s = status --short
|
s = status --short
|
||||||
ss = status
|
ss = status
|
||||||
br = branch -v
|
br = branch -v
|
||||||
brt = "!sh -c gbrt"
|
|
||||||
|
l = log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
|
||||||
# show a pretty log graph
|
# show a pretty log graph
|
||||||
lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
|
lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'
|
||||||
# list all aliases
|
|
||||||
la = "!git config -l | grep alias | cut -c 7-"
|
|
||||||
# show files that have changed between two branches (git dbr master..branch)
|
|
||||||
dbr = diff --name-status
|
|
||||||
# show diff of cached files
|
|
||||||
gdc = diff --cached
|
|
||||||
# show changed files for a commit
|
|
||||||
cf = show --pretty="format:" --name-only
|
|
||||||
# undo a commit
|
|
||||||
undo = reset --soft
|
|
||||||
# show what I did today
|
# show what I did today
|
||||||
day = "!sh -c 'git log --reverse --no-merges --branches=* --date=local --after=\"yesterday 11:59PM\" --author=\"`git config --get user.name`\"'"
|
day = "!sh -c 'git log --reverse --no-merges --branches=* --date=local --after=\"yesterday 11:59PM\" --author=\"`git config --get user.name`\"'"
|
||||||
|
|
||||||
|
# order files by number of commits, ascending
|
||||||
churn = "!f() { git log --all -M -C --name-only --format='format:' \"$@\" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print \"count\tfile\"} {print $1 \"\t\" $2}' | sort -g; }; f"
|
churn = "!f() { git log --all -M -C --name-only --format='format:' \"$@\" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print \"count\tfile\"} {print $1 \"\t\" $2}' | sort -g; }; f"
|
||||||
|
|
||||||
# current branch
|
# current branch
|
||||||
cbr = rev-parse --abbrev-ref HEAD
|
cbr = rev-parse --abbrev-ref HEAD
|
||||||
|
|
||||||
# assume aliases
|
|
||||||
assume = update-index --assume-unchanged
|
|
||||||
unassume = update-index --no-assume-unchanged
|
|
||||||
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
|
|
||||||
unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged"
|
|
||||||
|
|
||||||
# tag aliases
|
|
||||||
lt = describe --tags --abbrev=0
|
|
||||||
|
|
||||||
fixup = !sh -c 'git commit --fixup=$1' -
|
|
||||||
squash = !sh -c 'git commit --squash=$1' -
|
|
||||||
ri = rebase --interactive --autosquash
|
|
||||||
|
|
||||||
# stash shortcuts
|
|
||||||
sp = stash pop
|
|
||||||
sw = stash save
|
|
||||||
sl = stash list
|
|
||||||
sh = show --pretty="format:" --name-only
|
|
||||||
|
|
||||||
# submodule shortcuts
|
# submodule shortcuts
|
||||||
si = submodule init
|
si = submodule init
|
||||||
su = submodule update
|
su = submodule update
|
||||||
@@ -64,7 +40,7 @@
|
|||||||
count = shortlog -sn
|
count = shortlog -sn
|
||||||
|
|
||||||
undo = reset --soft HEAD~1
|
undo = reset --soft HEAD~1
|
||||||
amend = commit --amend -C HEAD
|
amend = commit -a --amend
|
||||||
|
|
||||||
cleanup = "!git remote prune origin && git gc && git clean -df && git stash clear"
|
cleanup = "!git remote prune origin && git gc && git clean -df && git stash clear"
|
||||||
|
|
||||||
@@ -73,7 +49,7 @@
|
|||||||
|
|
||||||
# tag aliases
|
# tag aliases
|
||||||
# show the last tag
|
# show the last tag
|
||||||
lasttag = describe --tags --abbrev=0
|
lt = describe --tags --abbrev=0
|
||||||
|
|
||||||
# assume aliases
|
# assume aliases
|
||||||
assume = update-index --assume-unchanged
|
assume = update-index --assume-unchanged
|
||||||
@@ -95,7 +71,6 @@
|
|||||||
aa = !git ls-files -d | xargs git rm && git ls-files -m -o --exclude-standard | xargs git add
|
aa = !git ls-files -d | xargs git rm && git ls-files -m -o --exclude-standard | xargs git add
|
||||||
# remove grep - Remove found files that are NOT under version control
|
# remove grep - Remove found files that are NOT under version control
|
||||||
rg = "!sh -c 'git ls-files --others --exclude-standard | grep $1 | xargs rm' -"
|
rg = "!sh -c 'git ls-files --others --exclude-standard | grep $1 | xargs rm' -"
|
||||||
g = grep --break --heading --line-number
|
|
||||||
[color]
|
[color]
|
||||||
diff = auto
|
diff = auto
|
||||||
status = auto
|
status = auto
|
||||||
|
|||||||
Reference in New Issue
Block a user