use git smudge/clean to replace file contents

后端 未结 2 1765
失恋的感觉
失恋的感觉 2020-12-03 13:04

I am attempting to use git to manage deployment to my live website. The problem that I\'m having is that I have a couple of settings files that I don\'t want to be updated w

2条回答
  •  无人及你
    2020-12-03 13:28

    I think, you have to read topic Customizing Git - Git Attributes in Git Book from start to end in order to have full picture, but especially carefully inspect part "Keyword Expansion", where custom hand-made scripts used to coverting KEYWORD in repository to FINAL TEXT in Working Directory (and in back). They are any code, which can be executed on host with Working Directory, referenced from .gitattributes file

    Note: Because you have to have different clean-filter output (for local and live), you may have two slightly different (in content) clean scripts on local and live WorkingDir under common filename (in book's sample clean result in equal for all locations - single script used).

提交回复
热议问题