Skip to content

Instantly share code, notes, and snippets.

@fada21
Last active March 5, 2021 11:26
Show Gist options
  • Save fada21/fa22916048f9df34be31132eb5b13b9f to your computer and use it in GitHub Desktop.
Save fada21/fa22916048f9df34be31132eb5b13b9f to your computer and use it in GitHub Desktop.
# gitconfig with aliases
cat > ~/.gitconfig << EOF
[alias]
list = !git config -l | grep alias | cut -c 7-
up = fetch
st = status
br = branch
brn = !git rev-parse --abbrev-ref HEAD
brd = branch -D
co = checkout
ada = add -A
cob = checkout -b
ci = commit
caa = commit -a --amend -C HEAD
cia = !git add -A && git commit -m
pub = !git push -u origin $(git brn)
last = diff --cached --minimal HEAD^
lgg = log --pretty=format:\"%C(yellow)%h%Creset %ad | %s %C(yellow)[%an]%Creset\" --date=short --graph
lgs = log --pretty=format:\"%C(yellow)%h%Creset %ad | %s %C(yellow)[%an]%Creset\" --date=short --numstat
lgp = log --pretty=format:\"%C(yellow)%h%Creset %ad | %s %C(yellow)[%an]%Creset\" --date=short --first-parent
lgf = log --pretty=format:\"%C(yellow)%h%Creset %ad | %s %C(yellow)[%an]%Creset\" --date=short --follow --
lgd = log --follow -p --minimal --
sha = rev-parse --short HEAD
rb = rebase
rbi = rebase -i
sub = submodule update --init --recursive
rst = reset --hard
prn = !git remote prune origin
purge = !git reset --hard && git clean -df
clrbr = !git branch --merged | grep -v \"\\*\" | xargs -n 1 git branch -d && git prn
find = !git ls-files | grep -i
tagup = !sh -c 'git tag $1 && git push origin $1' -
omit = update-index --assume-unchanged
omitl = !git ls-files -v | grep '^h'
omitu = update-index --no-assume-unchanged
export = archive -o repo.zip HEAD
[user]
email = l*.*i@gmail.com
name = fada21
[push]
default = simple
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment