Skip to content

Instantly share code, notes, and snippets.

View johnwgillis's full-sized avatar

John Gillis johnwgillis

View GitHub Profile
@johnwgillis
johnwgillis / DeleteAllBranchesExceptMaster.md
Last active January 7, 2020 19:23
How to delete all branches except for master locally and on a remote

Delete all local branches except for master

git branch | grep -v 'master$' | xargs git branch -D

Delete all remote branches except for master

REMOTE_NAME="origin"
command -v parallel || brew install parallel
git branch -r | grep $REMOTE_NAME/ | grep -v 'master$' | grep -v HEAD | cut -d/ -f2- | parallel git push $REMOTE_NAME --delete
@johnwgillis
johnwgillis / How to setup GPG for git.md
Last active August 8, 2024 19:19
How to setup GPG for signing commits with Git, SourceTree, and GitHub on Mac

How to setup GPG for signing commits with Git, SourceTree, and GitHub on Mac

  1. Install GPG tools
    1. Install GPG tools and setup pin entry by running:
    brew install gnupg pinentry-mac
    mkdir -m 700 -p ~/.gnupg
    echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf
    killall gpg-agent