Skip to content

Using git secret

Divyansh Verma edited this page Sep 19, 2020 · 1 revision

Using git secret to hide secrets in projects

  1. Create your gpg key pair if you don't have one.
    1.1 gpg --full-gen-key
    1.2 Select RSA.
    1.3 Enter 4096 as key length.
    1.4 Enter 0 for key to never expire.
    1.5 Follow the rest of the instructions.

  2. Install git secret. Follow instructions for your OS given here.

  3. Import DevClub's public gpg key. The public gpg key can be found here.
    gpg --import <path to file containing public key>

  4. Using git secret
    4.1 Add .env to .gitignore
    4.2 If git secret has not already been initialized, in the root directory of the repo, run git secret init
    4.3 Add people who can see your (needs to be done only once for a repo)
    git secret tell <your email address>
    git secret tell [email protected]
    4.4 Hide secrets(needs to be done every time the contents of .env are changed)
    git secret add .env
    git secret hide