How Can I Easily Set Secrets on Git Checkout?

139 Views Asked by At

In popular products like GitLab, you can use a CI/CD pipeline to set passwords and other sensitive information during deployment.

Is it possible for me to also do this when a developer clones the repository or checks out a specific branch?

Let's suppose I have the following remote file in Master, Production, Test and Development branches of Git:

config.txt
BufferSize=4096
Password=%passwordGoesHere%
BackgroundColor=Blue

When a developer clones the repository, I want the config.txt file of all accessible branches to be updated with the appropriate password.

I think VonC mentions filter drivers at [A] and [B], but I'm unsure how to create a filter driver. Also, from my limited understanding, a filter driver may not work on a per branch basis anyway per torek [C]

[A] - Can git automatically switch between spaces and tabs?
[B] - web.config and app.config machine-specific settings in git
[C] - git how to keep a config file different in different branches?

NOTE: I apologize if the SO community feels this question might be a duplicate

0

There are 0 best solutions below