What are some more forceful ways than a .gitignore to keep (force) files out of a repo?

前端 未结 2 902
轮回少年
轮回少年 2020-11-27 07:56

People on my dev team keep on pushing build specific files (node_modules and others) onto our repos despite these files being in a .gitignore file, presumably with git

2条回答
  •  孤独总比滥情好
    2020-11-27 08:47

    It's not an easy problem to solve as git is distributed.

    Server side filters like post commit hooks (or commit filter plugins if you are using Stash) allow the users to get themselves into a mess which is not great.

    The client pre-commit hook is cleaner because it prevents the users from polluting their repo but this solution isn't bullet proof.

    You could approach the problem from another perspective and move build artefacts and intermediate files out of you repository directory.

提交回复
热议问题