【问题标题】:Git doesn't ignore "nbproject" directoryGit 不会忽略“nbproject”目录
【发布时间】:2017-11-27 11:52:22
【问题描述】:

当我git push我的项目时,它不会忽略“.gitignore”文件中的“nbproject”目录!

我试过了:

git rm -r --cached nbproject

它仅在下一次 git push 中停止跟踪“nbproject”,但它将从第二次 push 再次推送!

为什么会这样??!

【问题讨论】:

  • “不忽略”是什么意思? git push 不查看 .gitignore 文件。
  • @j6t 我的意思是“nbproject”目录被推送到了 git repo 虽然它不应该被推送,因为我把它放在“.gitignore”文件中
  • @1615903 不,我不问这个。我试图做到这一点,它从回购中删除了“nbproject”,但它在下一次 git push 时再次被推送!

标签: git netbeans-8


【解决方案1】:

使用git rm -r --cached nbproject/ 从下一次提交停止跟踪nbproject(不删除它)。

.gitignore 将不适用于已被跟踪的文件。

【讨论】:

  • 我试过这个..它只在下一次 git push 中停止跟踪“nbproject”,但它会从第二次推送再次被推送!!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-02-10
  • 1970-01-01
  • 2011-08-12
  • 1970-01-01
  • 1970-01-01
  • 2014-11-20
相关资源
最近更新 更多