How to ignore files which are in repository?

后端 未结 4 1313
隐瞒了意图╮
隐瞒了意图╮ 2020-12-12 11:04

I have a file (config.php), that is already commited to Git repository, but I want to ignore locally, i.e. I want that file to remain in repository, but force Git to ignore

4条回答
  •  心在旅途
    2020-12-12 11:50

    If the file is already in the repository, and hence the Index/Staging area, then an update to .gitignore won't change that situation - It would keep beinging committed.

    To remove the file from the Index/Staging area use git rm .

提交回复
热议问题