Expand description
Reading and writing the repository key on disk.
Two shapes, both holding the same 32-byte master key — never a cipher key, so a future suite cannot strand either of them:
- the binary file in
.git/git-xcrypt/keys/, which the tool reads on every filter run and no human ever looks at; - the portable text file
encode_portableproduces, which is whatexport-keywrites andunlockreads. It is text so it survives a password manager, an email body and a copy-paste, and it names itskey_idin the clear so a user can tell two exports apart without decrypting anything.
Both carry their own magic and version, independent of the data format’s, because the three evolve for different reasons.
Functions§
- decode_
portable - Parses the portable text form.
- encode_
portable - Renders
keyin the portable text formexport-keywrites. - holds_
a_ key - Whether
contentis one of this tool’s key files, in either shape. - read
- Reads the key stored at
path. - read_
portable - Reads a key from a portable file.
- write
- Writes
keytopath, creating parent directories. - write_
owner_ only - Creates
pathwith owner-only permissions and writescontents. - write_
portable - Writes
keytopathin the portable form, owner-only.