Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I `git diff` changes to rails 5.2 credentials?

I want to be able to diff the changes to my encrypted config/credentials.yml.enc.

git diff alone shows the difference to the encrypted file contents. I want to see the plaintext changes.

How can I get a human readable diff of the config/credentials.yml.enc file?

like image 458
tommarshall Avatar asked Mar 27 '18 13:03

tommarshall


Video Answer


1 Answers

This will work if you use rails encrypted:show instead of rails credentials:show as it takes a file as an argument.

For a global configuration add to your .gitconfig

[diff "enc"]
  textconv = rails encrypted:show
  cachetextconv = false

and then in ~/.config/git/attributes

*.yml.enc diff=enc
like image 84
Ian Grant Avatar answered Sep 28 '22 02:09

Ian Grant