Git: Ignore files for public repository, but not for private

后端 未结 8 1057
心在旅途
心在旅途 2020-12-01 07:54

I\'m deploying a Rails app on Heroku (for now) via git, and would also like to have a public version for people to look at. Some files are sensitive and should only be commi

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-01 08:11

    I know this sidesteps the question, but I would simply have two git repositories. Then you can just add them permanently to the ignore list on the public repository.

    You can have a second repository for the private files, and a small script to copy the changes to the correct location on the production system, when doing your deployment.

    This reduces the risk that when you go on vacation and the new intern updates the public repo, your private information will accidentally get leaked. ;-)

提交回复
热议问题