git-mix is inspired by git-crypt but implemented by rust.
Based on Git Attributes. Using the “clean” and “smudge” filters , we can can set a filter for particular paths before they’re checked out and staged as the following:
Thanks to cargo :)
cargo install git-mix
- edit the .gitattributes to set the path you want to mix as the following:
private/* filter=git-mix
.gitattributes !filter
- run
git-mix gen
to generate the config for defining the filtergit-mix
[filter "git-mix"]
clean = git-mix encrypt --key BiqdSyKwmnIFDKg1LzXIg5eEM3RWbdUb
smudge = git-mix decrypt --key BiqdSyKwmnIFDKg1LzXIg5eEM3RWbdUb
-
append template to .git/config
-
remember the key, or you can reset the key which is required 32 bytes by
git-mix genkey
or yourself -
commit the private data and push remote to checkout the mixed data:)
- git clone -n giturl
- run
git-mix gen --key <key>
to generate the filter template
❯ git-mix gen --key BiqdSyKwmnIFDKg1LzXIg5eEM3RWbdUb 127ms
[filter "git-mix"]
clean = git-mix encrypt --key BiqdSyKwmnIFDKg1LzXIg5eEM3RWbdUb
smudge = git-mix decrypt --key BiqdSyKwmnIFDKg1LzXIg5eEM3RWbdUb
- append the template to .git/config
- git reset --hard HEAD
- check the private data :)
To contribute to git-mix, clone this repo locally and commit your code on a separate branch.
PS: PR Welcome 🚀 🚀 🚀 🚀
GitHub @detailyang
git-mix is licensed under the MIT license.