git 移除已经添加到版本库中的文件 发表评论 3,221 A+所属分类:Git 收 藏在开发中,不小心将数据库配置文件 database.php 加入到 git 版本中,那么如何移除呢? 首先找到 .gitignore 文件,将文件路径写入: config/database.php 接下来在git版本库中删除 database.php: git rm -r -cached . git add . git commit -m 'update .gitignore' git push 既可以完成。 赞 0 赏 分享