dbs67
4/10/2017 - 4:56 PM

Encrypted .netrc for Git

Encrypted .netrc for Git

# 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