Skip to content

Instantly share code, notes, and snippets.

@ghaake
Created May 21, 2019 19:42
Show Gist options
  • Save ghaake/f8091aef43579c415a19ad0dac8c1a1f to your computer and use it in GitHub Desktop.
Save ghaake/f8091aef43579c415a19ad0dac8c1a1f to your computer and use it in GitHub Desktop.
Usefull alias git commands for lazy shell users
git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.br branch
git config --global alias.ba "branch -a"
git config --global alias.bl "branch -l"
git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
@ghaake
Copy link
Author

ghaake commented Jul 7, 2021

futher usefull aliases

git config --global alias.caam=commit -a --am --no-edit
git config --global alias.unstage=reset HEAD --
git config --global alias.last=log -1 HEAD
git config --global alias.ll=log --oneline
git config --global alias.cm=commit -m
git config --global alias.rv=remote -v
git config --global alias.search=!git rev-list --all | xargs git grep -F
git config --global alias.gl=config --global -l
git config --global alias.brd=branch -d
git config --global alias.brp=branch -D

@ghaake
Copy link
Author

ghaake commented May 16, 2022

git config --global alias.sweep=!git branch --merged $([[ $1 != \"-f\" ]] [\\\n&&](file:///n&&) git rev-parse master) | egrep -v \"(^\\*|^\\s*(main|release|master|develop)$)\" [\\\n|](file:///n:/) xargs git branch -d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment