Last active
December 10, 2018 02:42
-
-
Save john20xdoe/53ea154ecc1a10f21826d35bdcbf391e to your computer and use it in GitHub Desktop.
Docker and Git commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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