Skip to content

Instantly share code, notes, and snippets.

@kinncj
Last active August 10, 2017 14:18
Show Gist options
  • Save kinncj/4b1979893ee4458162c72c617098685c to your computer and use it in GitHub Desktop.
Save kinncj/4b1979893ee4458162c72c617098685c to your computer and use it in GitHub Desktop.
few things
# ~/.bash_profile
# ...
# Docker cleanup
dcleanup(){
docker rm -v $(docker ps --filter status=exited -q 2>/dev/null) 2>/dev/null
docker rmi $(docker images --filter dangling=true -q 2>/dev/null) 2>/dev/null
}
# Git cleanup
gitcleanup() {
git fetch -p && for branch in `git branch -vv | grep ': gone]' | gawk '{print $1}'`; do git branch -D $branch; done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment