Ignore configs with git

前端 未结 1 391
悲哀的现实
悲哀的现实 2021-01-16 12:41

In my project I have config files that have private information. I committed some example templates to Github, but I have the actual configs in my working copy so I can buil

相关标签:
1条回答
  • 2021-01-16 13:20

    That looks like what a content filter driver (using .gitattributes declaration) is for:

    • the smudge part could replace the template content with the actual value (on checkout)
    • the clean part could restore the template (on commit)

    enter image description here

    (image from "Customizing Git - Git Attributes", from "Pro Git book")

    0 讨论(0)
提交回复
热议问题