美文网首页
老项目添加 gitignore

老项目添加 gitignore

作者: 前行哲 | 来源:发表于2024-03-24 08:10 被阅读0次

在给老项目添加 .gitignore 文件时,如果你已经有文件被跟踪并提交到了仓库,那么这些文件将不会被 .gitignore 文件自动忽略。为了从 Git 中移除这些文件并使 .gitignore 文件生效,需要运行以下命令:

git rm -r --cached .
git add .
git commit -m "Remove tracked files"

相关文章

网友评论

      本文标题:老项目添加 gitignore

      本文链接:https://www.haomeiwen.com/subject/ecukzdtx.html