Skip to content

Instantly share code, notes, and snippets.

@jgunnink
Created January 16, 2019 07:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgunnink/00714353f09855220cc54c0132f88cd9 to your computer and use it in GitHub Desktop.
Save jgunnink/00714353f09855220cc54c0132f88cd9 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
GIT_CONFIG=$(git config --show-origin --get credential.helper)
if [[ ${GIT_CONFIG} == **osxkeychain** ]]; then
FILE=$(echo ${GIT_CONFIG} | awk '{print $1}' | sed s/'file:'//)
sudo sed -i.bak '/\[credential\]$/N; /\[credential\]/d' $(echo ${FILE})
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment