我已将构建文件夹推送到我的远程仓库;但.gitignore文件显然有这一行(/ payu_ui / build);但我发现,因为构建文件已被跟踪一次,现在我在.gitignore写了一行不会真正忽略构建文件夹。所以我想从被跟踪的git中删除它(完整的构建文件夹)所以我使用了这个命令
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch payu_ui/build/' --prune-empty --tag-name-filter cat -- --all
但是每次我运行这个命令都会给出错误的说法
fatal: bad revision 'rm'
出了什么问题;每次我从IDE单击提交选项时,它都会显示需要提交1300个文件(令我讨厌)
任何帮助将不胜感激;
1.我不想跟踪这些构建文件(来自payu_ui lib)
2.我不想将它们推送到远程仓库(但是当我从本地跟踪它并且推动它们在远程仓库中被删除时它已经很好了!如果它没有在远程仓库中手动删除)
答案 0 :(得分:12)
Well you may just do the following,
I recently faced the problem and that is what i did.
答案 1 :(得分:2)
remove those build files (or whole folder) from your computer
rm -r [direction to files]
then add, commit and push all your changes (actually the change will be removing those files from repository), if you have set .gitignore
file properly, git will stop tracking those files