mirror of
https://github.com/AGWA/git-crypt.git
synced 2025-12-27 05:03:07 -08:00
add support for "git-crypt lock"
This does the reverse of what git-crypt unlock does:
- unconfigures the git filters
- forcibly checks out HEAD version
Usage:
git crypt lock locks repo using the "default" key
git crypt lock -k NAME locks the repo, using unlocked key named NAME
git crypt lock --key-name=NAME
git crypt lock -a locks the repo, removing ALL unlocked keys
git crypt lock --all
Result is that you can now decrypt and then revert back to encrypted
form of files and vice versa.
Modified-by: Andrew Ayer <agwa@andrewayer.name>
* Make argv argument to lock() const.
* Minor whitespace/style fixes to conform to project conventions.
Signed-off-by: Andrew Ayer <agwa@andrewayer.name>
This commit is contained in:
committed by
Andrew Ayer
parent
316e194f84
commit
3726df181d
@@ -57,6 +57,7 @@ static void print_usage (std::ostream& out)
|
||||
//out << " rm-gpg-key KEYID revoke collaborator status from the given GPG key ID" << std::endl;
|
||||
//out << " ls-gpg-keys list the GPG key IDs of collaborators" << std::endl;
|
||||
out << " unlock decrypt this repo using the in-repo GPG-encrypted key" << std::endl;
|
||||
out << " lock check out encrypted versions of files in this repo" << std::endl;
|
||||
out << std::endl;
|
||||
out << "Symmetric key commands:" << std::endl;
|
||||
out << " export-key FILE export this repo's symmetric key to the given file" << std::endl;
|
||||
@@ -135,6 +136,9 @@ try {
|
||||
if (std::strcmp(command, "unlock") == 0) {
|
||||
return unlock(argc, argv);
|
||||
}
|
||||
if (std::strcmp(command, "lock") == 0) {
|
||||
return lock(argc, argv);
|
||||
}
|
||||
if (std::strcmp(command, "add-gpg-key") == 0) {
|
||||
return add_gpg_key(argc, argv);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user