you may totally ignore complicated gpg manuals, but you must understand how
git-crypt
operates.
gpg
2.2+ uses AES256 by default, so your secrets are fully depend on the passphrase you are going to use.
πππ
Β‘ instructions are intentionally provided for empty repository, otherwise it cannot be guaranteed that files you are going to encrypt haven't been leaked to the repo in previous commits !
mkdir encrypted-repo && cd encrypted-repo
git init && git-crypt init
curl --user GITHUB_NAME https://api.github.com/user/repos --data '{ "name": "encrypted-repo" }' && \
git remote add origin https://github.com/GITHUB_NAME/encrypted-repo.git
git-crypt export-key -- - | gpg --symmetric --armor --output local.key.asc
echo "secretfile filter=git-crypt diff=git-crypt" >> .gitattributes
echo "secretfile2 filter=git-crypt diff=git-crypt" >> .gitattributes
git add local.key.asc .gitattributes .gitignore
git commit --message="Config: git-crypt settings"
git push --set-upstream origin master
Follow your usual git workflow, git-crypt will take care of transparent encryption of selected files.
When you need the new file to be encrypted, add it to .gitattributes
as stated in Add files which need to be encrypted to .gitattributes
.
πππ
‘‘‘ Do it before adding withgit add
otherwise non-encrypted file will be committed & pushed to the Internet !!!
git clone https://github.com/GITHUB_NAME/encrypted-repo.git && cd encrypted-repo
gpg --decrypt local.key.asc | git-crypt unlock -