我正在使用grails,ggts并通过以下方式生成了我的.gitignore
文件:
与--git集成
它包含一行
/target/
我认为应该从版本控制中排除目标内容,尤其是生成的 war 文件。
但是所有目标内容都包含在存储库更新中。
如何避免呢?
最佳答案
目标已经过版本控制,在其中添加带有/ target /的.gitignore不会改变它。
在应用.gitignore之前,您需要首先从索引中删除该文件夹,并记录该删除。
git rm -r --cached target/
git commit -m "remove target from index"
关于git - 我怎样才能使.gitignore工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29047483/