Skip to content

How would you encrypt an existing repository with git-crypt? #270

Answered by alerque
omduggineni asked this question in Q&A
Discussion options

You must be logged in to vote

All three of those ways would work, but depending on your repository layout and history the easiest might be just to rebase. Branch from before the first commit that had private content than needed encryption. Add a new commit to the branch that sets the attributes, then add the encrypted file. Then rebase your original branch onto the new one, dropping or editing the commit that added the unencrypted version. If your history includes changes to the encrypted data along the way you'll want to make sure and inspect those with a break in the rebase after them to make sure they still show encrypted properly.

Other approaches will work too, including using one of the filter options to remove …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@omduggineni
Comment options

Answer selected by omduggineni
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants