Mark a file in the GIT repo as temporarily ignored

后端 未结 2 634
-上瘾入骨i
-上瘾入骨i 2020-12-06 01:58

We\'re migrating from Perforce to GIT. In perforce, there were some files that I\'d want in the repository, but they shouldn\'t be checked in by individual developers regul

相关标签:
2条回答
  • 2020-12-06 02:34

    You are probably looking for

    git update-index --assume-unchanged .project

    0 讨论(0)
  • 2020-12-06 02:46

    If you need a common base for those (.project, .classpath, ...), you can:

    • version template version of those files (.project_tpl, .classpath_tpl, ...)
    • use a filter driver to generate, on checkout, the actual files (which won't be versioned, and only modified locally by the developers)

    alt text

    (the 'clean' step during commit wouldn't do anything for those templates.
    Only the 'smudge' step is used here, to generate the private files)

    Note: this is a slight "mis-use" of a filter driver, which is supposed to process only file contents, not to generate new ones.
    But it could help you in your scenario (provided your 'smudge' script doesn't overwrite blindly the eclipse files if they happen to already be here.)

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