Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to undo git-crypt, e.g. remove item from .gitattributes #170

Open
dazza-codes opened this issue Feb 21, 2019 · 6 comments
Open

Comments

@dazza-codes
Copy link

There is documentation about how to apply git-crypt, but nothing to un-apply it. What happens when a file that is encrypted, with an entry in the .gitattributes file to use the git-crypt filters, and a new commit removes the .gitattributes entry? How is a file intentionally released from git-crypt filters?

@alerque
Copy link
Contributor

alerque commented Feb 24, 2019

  1. Checkout and unlock a copy of the repository.
  2. Remove the relevant attribute filter lines.
  3. git-add the unlocked state of the files that were previously encrypted from your working directory and commit them.

@redthor
Copy link

redthor commented Oct 23, 2019

FWIW, I found that my PR on GitHub to unencrypt a file showed the .gitattributes changes but the file still looked encrypted. You are able to view the file however and it is unencrypted.

@yangzii0920
Copy link

1. Checkout and unlock a copy of the repository.

2. Remove the relevant attribute filter lines.

3. `git-add` the unlocked state of the files that were previously encrypted from your working directory and commit them.

Doesn't work.
first off git-add is not found...
then did git add after unlock, update .gitattribute. File pushed still encrypted on github. (locally it's not encrypted, but if I clone again it would be)

@ilia-tsyplenkov
Copy link

Had same issue. Only next tricky works for me (problem file is a foo.py in this example):

  • cat foo.py > spam.py
  • git add spam.py; git commit -m "added version without enc"; git push
  • delete foo.py mention from .gitattributes file
  • git rm foo.py
  • git add .gitattributes.py; git commit -m "delete encrypted version"; git push
  • git mv spam.py foo.py; git commit -m "rename version without encyption"; git push

@hvhaugwitz
Copy link

hvhaugwitz commented Mar 2, 2021

To avoid multiple commits and moved around files the following worked for me:

  • checkout and unlock repo
  • remove [filter "git-crypt"] and [diff "git-crypt"] sections from .git/config
  • remove corresponding lines in .gitattributes and add changes to the index
  • remove symmetric key (if any) rm .git/git-crypt -r
  • remove (encrypted) path only from the index git rm --cached foobar
  • re-add local (unencrypted) path to the index git add foobar
  • commit and push the changes

@Tointoin
Copy link

Tointoin commented Nov 9, 2021

I tried @ilia-tsyplenkov and @hvhaugwitz workarounds but my file is style encrypted and considered as binary on Github entreprise.

My problem with their solutions is that .gitattributes has already been modified before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants