Last active
December 11, 2018 21:22
-
-
Save eamonnfaherty/3399458cb7f5569567bd414057e0dde7 to your computer and use it in GitHub Desktop.
delete your internet password for AWS CodeCommit repos
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
#!/bin/sh | |
# guide on how to add global git hooks: | |
# https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook | |
# add this as a pre-push git hook | |
# .git/hooks/pre-push | |
remote="$1" | |
url="$2" | |
REGION=$(git remote -v | grep codeco | awk -F\/ '{print $3}' | awk -F. '{print $2}' | uniq) | |
security delete-internet-password -l "git-codecommit.$REGION.amazonaws.com" ~/Library/Keychains/login.keychain 1>/dev/null 2>/dev/null || true | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment