Protecting files in git repository

后端 未结 4 933
臣服心动
臣服心动 2021-01-02 05:51

I have a central repository with a subset of files that I want to protect from being changed (by pushing) from other users. If I add these files to .gitignore,

4条回答
  •  伪装坚强ぢ
    2021-01-02 06:12

    You can have the files in the repository, commit them, then add them to the .gitignore and then remove them from the next commit.

    You can still fetch the files directly prior commit (perhaps tag it with something so it can be fetched by name a bit easier) and this will preserve the state of the file, while not making it easily edited in the repository by accident.

    To access those files after pulling the clone, just write a rake task that fetches them for the user of your repository.

提交回复
热议问题