Skip to content

Instantly share code, notes, and snippets.

@john20xdoe
Last active December 10, 2018 02:42
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 john20xdoe/53ea154ecc1a10f21826d35bdcbf391e to your computer and use it in GitHub Desktop.
Save john20xdoe/53ea154ecc1a10f21826d35bdcbf391e to your computer and use it in GitHub Desktop.
Docker and Git commands
# Remove all containers
docker stop $(docker ps -a -q)
# Option 1
docker rm $(docker ps -a -q)
#Option 2
docker rm -f -v $(sudo docker ps -a -q)
# Remove untagged containers only
docker rmi -f $(docker images | grep "<none>" | awk "{print \$3}")
# Rename branches with prefix "bugfix/" with "_xxx/"
# Can apply to feature/ as well
# https://stackoverflow.com/questions/45118089/git-rename-multiple-branches
git branch | grep "bugfix/" | awk '{original=$1; sub("bugfix/","_xxx/"); print original, $1}' | xargs -n 2 git branch -m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment