Skip to content

ltetrel/git-crypt-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Encrypt your github repository

Sometimes you want to keep the history of some files on a public git repo, but don't want to let users see it. This is where git-crypt can help you, it allows to automatically decrypt/uncrypt specified files when you pull or push a repository.

Installation

sudo apt-get install git-crypt

Encrypt your github repository

  1. Let's say you have a new repository and you want to encrypt passwords.yaml
README.md
encrypted/passwords.yaml
  1. Create the git-crypt key and put here somewhere safe
git-crypt keygen gitcrypt-key
mv gitcrypt-key ~/.ssh
  1. Go to your directory and add a .gitattributes to specify which files you want to encrypt, for example containing:
encrypted/passwords.yaml filter=git-crypt diff=git-crypt
  1. Add, push and commit all the files but not the one you want to encrypt. This is verry important since if you commit everything you will have a commit showing your files that you want to encrypt.
git add README.md
git commit
git push
  1. You can now initialize the git-crypt configruation
git-crypt init ~/.ssh/gitcrypt-key
  1. Add the files taht you will encrypt
git add encrypted/passwords.yaml
  1. Encrypt these files and check if they are indeed encrypted (it should output a long message beginning with ^@GITCRYPT^@)
git lock -f
  1. If it is encrypted, you can now commit and push
git commit
git push
  1. Later, to decrypt the files just do:
git-crypt unlock ~/.ssh/gitcrypt-key

About

Encyption test using git-crypt

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors