This is a collection of commands I use fairly regularly, but sometimes forget.

Table of Contents


  • Delete all not running containers docker rm $(docker ps -q -a)
  • Delete all running containers docker rm -f $(docker ps -q -a)
  • Delete all images docker rmi -f $(docker images -q -a)
  • Delete dangling volumes and images docker volume rm $(docker volume ls -q -f "dangling=true") ; docker rmi $(docker images -q -f "dangling=true")

Modify a commit in git history


  • HEAD
  • f673769
  • 5b5a808
  • cf08425
  1. To modify 5b5a808, run: git rebase --interactive 5b5a808^
  2. Edit the line with the commit you want to change from pick to edit
  3. Do your changes, add your changes and amend the commit: git commit --all --amend
  4. Continue rebase: git rebase --continue


# Change comment char so gitlab issues can be referenced in commit messages
git config --global core.commentchar ";"

# Auto --prune on pull or fetch
git config --global fetch.prune true


# Remove branches that don't have a remote tracking branch
alias git-remove-branch='git branch -d $(git branch --merged master | grep -v "^[ *]*master")'