how to apply an older patch in local GIT repository?

Are there git hooks for sanitize private information in Rails project to push to a public git repository?

  • I want to be able to share the code publicly, but some settings are private. How do I set it up to sanitize the private information, and push it up to a public repository.

  • Answer:

    Actually, there’s a much simpler way than using hooks.  Put the private settings into a separate file.  You can include the separate file into your main settings file with the ruby load statement or similar.  Then add the separate file to http://git-scm.com/docs/gitignore and don’t check it into the repository. The problem with trying to do this with hooks is that it would basically amount to maintaining two distinct parallel histories.  You’ll just confuse everyone that has to interact with that setup. Keeping your secrets in a separate file (or even a separate repository) is best practice, and it really is the simpler solution.

Anders Kaseorg at Quora Visit the source

Was this solution helpful to you?

Other answers

Could you expose private information through environment variables?  It's what heroku does: http://devcenter.heroku.com/articles/config-vars

Sam Neubardt

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.