How to ignore a file which is already committed?

后端 未结 2 846
醉话见心
醉话见心 2021-02-01 16:24

Previously, the following was my .gitignore file:

...
config/database.yml
.DS_Store

Later I created an app_config.yml

2条回答
  •  死守一世寂寞
    2021-02-01 17:17

    that doesn't help when you want to start ignoring a file that is committed and you want to keep it in the project... since git rm --cached would delete it from git repo...

    I found this How do I stop Git from tracking any changes to a file from this commit forward? which is what I was looking for..

    hopefully it's useful for other people as well...

提交回复
热议问题