AI编程生活评测
编程笔记 · 2024-04-17 · 1 min read

git中将已跟踪的文件添加到.gitignore

环境配置文件.env之前被push到远端仓库了,现需要将其从代码库中删除并清除跟踪。 备注:操作前请先备份有用的文件内容。 添加 .gitignore 文件,编辑内容:
.env
执行操作:
git pull
git rm -r --cached .
git add .
git commit -m "add .gitignore"
git push
点击刷新