about summary refs log tree commit diff stats
path: root/notes/git_crypt.md
blob: 8c42bb62ecc618ca3bd944899eede4a296148f7a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!--
nixos-config - My current NixOS configuration

Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
SPDX-License-Identifier: GPL-3.0-or-later

This file is part of my nixos-config.

You should have received a copy of the License along with this program.
If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
-->

# What to do, when nix wants to build the locked repository

Simply delete the source path:

```
sudo nix store delete --ignore-liveness <source_path>
```

# How to remove git crypt [1]:

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 --recursive .git/git-crypt`
- 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

[1]: https://github.com/AGWA/git-crypt/issues/170#issuecomment-788820507