Skip to content

Instantly share code, notes, and snippets.

View johnwgillis's full-sized avatar

John Gillis johnwgillis

View GitHub Profile
@johnwgillis
johnwgillis / How to setup GPG for git.md
Last active April 22, 2024 17:13
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
    
@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