Skip to content

Instantly share code, notes, and snippets.

:octocat:
Coding

Renan Borges renanborgez

:octocat:
Coding
Block or report user

Report or block renanborgez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View clear-local-branches.txt
## Delete local braches already merged
git fetch --prune && git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d
## Delete local braches
git fetch --prune && git branch | egrep -v "(^\*|master|dev)" | xargs git branch -d
@JeffBelback
JeffBelback / docker-destroy-all.sh
Last active Sep 27, 2019
Destroy all Docker Containers and Images
View docker-destroy-all.sh
#!/bin/bash
# Stop all containers
containers=`docker ps -a -q`
if [ -n "$containers" ] ; then
docker stop $containers
fi
# Delete all containers
containers=`docker ps -a -q`
if [ -n "$containers" ]; then
docker rm -f -v $containers
@jbgo
jbgo / git-recover-branch.md
Last active Oct 15, 2019
How to recover a git branch you accidentally deleted
View git-recover-branch.md

UPDATE: A better way! (August 2015)

As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!

 $ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring
You can’t perform that action at this time.