Created
June 24, 2015 06:34
-
-
Save soardex/bd588f633d03d8bd0f84 to your computer and use it in GitHub Desktop.
Encrypted .netrc for Git
This file contains hidden or 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
# encrypt ~/.netrc with gpg agent | |
gpg -e -r [your_gpg_id] ~/.netrc | |
# clean removed .netrc file | |
shred ~/.netrc | |
rm -f ~/.netrc | |
# enable credential helper | |
# this would search files in your home directory | |
# .authinfo.gpg | |
# .netrc.gpg | |
# .authinfo | |
# .netrc | |
git config --global credential.helper /usr/share/git/credential/netrc/git-credential-netrc | |
# committing files to server | |
echo "secret_password" | gpg push -u origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing this. Is this supposed to be
git push
instead ofgpg push
?