{"id":14955944,"url":"https://github.com/ccocchi/rails-credentials-git","last_synced_at":"2026-02-09T00:34:55.363Z","repository":{"id":56890505,"uuid":"256967708","full_name":"ccocchi/rails-credentials-git","owner":"ccocchi","description":"Fastest way to diff your Rails credentials files in git","archived":false,"fork":false,"pushed_at":"2022-08-26T18:38:43.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-13T15:12:27.515Z","etag":null,"topics":["diff","git","rails"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ccocchi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-19T10:07:34.000Z","updated_at":"2025-10-17T01:49:17.000Z","dependencies_parsed_at":"2022-08-20T16:00:50.795Z","dependency_job_id":null,"html_url":"https://github.com/ccocchi/rails-credentials-git","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ccocchi/rails-credentials-git","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccocchi%2Frails-credentials-git","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccocchi%2Frails-credentials-git/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccocchi%2Frails-credentials-git/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccocchi%2Frails-credentials-git/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ccocchi","download_url":"https://codeload.github.com/ccocchi/rails-credentials-git/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccocchi%2Frails-credentials-git/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29251546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T22:49:53.206Z","status":"ssl_error","status_checked_at":"2026-02-08T22:49:51.384Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diff","git","rails"],"created_at":"2024-09-24T13:12:03.676Z","updated_at":"2026-02-09T00:34:55.305Z","avatar_url":"https://github.com/ccocchi.png","language":"Ruby","readme":"# RailsCredentialsGit\n\nHave you ever been in the situation where you'd like to see the changes you made in your encrypted credentials when using `git diff` ? Or worse, having conflicts on the same credentials and only seeing two different encrypted strings ?\n\nA good stackoverflow solutions is to use `bin/rails encrypted:show`, but this will have to load your entire app not once but twice, resulting in having to wait a long (depending on your app size) time each time you diff credentials.\n\nThis gem brings you the same functionnality, at the fraction of the time, in less than 100 lines of code.\n\nIt has been tested successfully with Rails 5.2, 6.0 and 6.1.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'rails-credentials-git', group: :development, require: false\n```\n\nAnd then execute:\n\n```sh\n$ bundle install\n```\n\nFinally, run the following to have the ruby binary copied into your project's `bin/` folder:\n\n```sh\n$ bundle exec rails_credentials_git install\n```\n\n## Configuration\n\nNow we're going to configure `git` to use the binary you just installed. Add these lines to your `.git/config` file at the root of your project:\n\n```\n[diff \"enc\"]\n  textconv = ruby --disable-gems bin/enc\n  cachetextconv = false\n```\n\nIt defines a new diff mode named \"enc\", using our Rails binary to do the text conversion. Since it does not use any gem, we can use the `--disable-gems` option to speed up the execution.\nThe `cachetextconv = false` option, specify that git should not cache the text conversion which in our case would be the decrypted credentials.\n\nFinally, create a `.gitattributes` file at the root of your project or edit your existing one with the following lines:\n\n```\n*.yml.enc diff=enc -merge\n```\n\nIt instructs git to use you newly define mode \"enc\" when diff-ing files matching the `*.yml.enc` regexp.\n\nIf you're using a default Rails installation, everything is set up and you can now modify your credentials file and use `git diff` to see the results. If you're using a custom location for your `master.key`, you can use the env variable `RAILS_MASTER_KEY` (which is also used by Rails) to pass your key directly.\n\n## Usage\n\nIn addition, you can use this gem's binary during git conflicts (merge or rebase). Using\n\n```sh\nbin/enc --conflict # with RAILS_MASTER_KEY set if you need to\n```\n\n## Development\n\nAfter checking out the repo, run `bundle install` to install dependencies. Then, run `rake test` to run the tests.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/ccocchi/rails-credentials-git. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ccocchi/rails-credentials-git/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccocchi%2Frails-credentials-git","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fccocchi%2Frails-credentials-git","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccocchi%2Frails-credentials-git/lists"}