Skip to content

Instantly share code, notes, and snippets.

@nevergone
Created October 4, 2022 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nevergone/023f4cb6fada2714a0eb483afb192e4e to your computer and use it in GitHub Desktop.
Save nevergone/023f4cb6fada2714a0eb483afb192e4e to your computer and use it in GitHub Desktop.
git aliases
never@t470-never-20:38-~$ git aliases
ci=commit
cia=commit -a
ciam=commit --amend
stl=stash list
stp=stash pop
sts=stash save
stsu=stash save -u
stsp=stash show -p
subin=submodule init
subst=submodule status
subup=submodule update
subsum=submodule summary
subadd=submodule add
subsync=submodule sync
subfor=submodule foreach
st=status
co=checkout
br=branch
ls=ls-files
df=diff -w
sh=show -w
dfw=diff --word-diff
shw=show --word-diff
dfc=diff --cached
dfcw=diff --cached -w --word-diff
lg=log -p
pr=pull --rebase
addp=!git add -p && git commit
lol=log --color --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ai) %C(bold blue)"
lola=log --color --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)" --all
lolf=log --color --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)" --name-status
lolaf=log --color --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)" --all --name-status
local=log --branches --not --remotes
merged=branch --all --merged HEAD
not-merged=branch --all --no-merged HEAD
rb=rebase
rbc=rebase --continue
aliases=!git config -l | grep alias | cut -c 7-
added-file=log --diff-filter=A --
contributors=!git shortlog -n -s --no-merges $@ | cat - && echo && echo total $(git rev-list --count HEAD)
project-name=config --replace-all project.info.name
root=rev-parse --show-cdup
tree=log --all --graph --decorate --oneline --simplify-by-decoration --format="%Cred%h%Creset %cN %Cgreen%ad%Creset %Cblue%d%Creset%s" --date=short
find-br=branch --contains
find-brr=branch -r --contains
find-bra=branch -a --contains
undo=checkout --
unstage=reset HEAD --
cp=cherry-pick -x
fp=format-patch -k --stdout
cl=clean -dfx
pf=push --force-with-lease
ignored=ls-files -o -i --exclude-standard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment