This will get you a repository that automatically encrypts all files that you add to it and push.
- Get git and git-crypt and gpg
- Make sure you have a trusted private key in gpg
- Run
git-crypt init
in the root of your repo - Run
git-crypt add-gpg-user GPG_FINGERPRINT
- Create .gitattributes in the root of your repo
**/* filter=git-crypt diff=git-crypt
.gitattributes !filter !diff
*.gitignore !filter !diff
- Add .gitattributes to your repo
- Commit
Now any file that you add to the repo and push will be encrypted online
- Get git and git-crypt and gpg
- Make sure you have a trusted private key in gpg that was also added to the repository using
git-crypt add-gpg-user
- Clone your encrypted repo
- Run
git-crypt unlock
in the root of your repo
Your repository can become huge after some commits, so (in this rare case) it's better to delete your previous commit, create a new one and force push.
git reset --soft HEAD^
git-crypt unlock
git add .
git commit -m stuff
git push -f