即使我使用新提交删除了这些文件,我也无法将更改推送到具有黑名单模式的分支中。实际上,我在将更改推送到远程分支时收到以下错误。
remote: GitLab: File name domain/app-1.7.RELEASE.jar
was blacklisted by the pattern .+\.war|.+\.jar|.+\.exe|.+\.class|\.classpath|
\.project|\.settings|\.idea|.+\.iml|.+\.iws|\.flattened-pom.xml|target.
To gitlab.com:developerbhuwan/samplee.git
! [remote rejected] ok-cx -> ok-cx (pre-receive hook declined)
如何解决这个问题?
如果您已经创建了一个新的提交并删除了该文件:
即:
git reset --hard @~
git rm wrong_file
git commit --amend "delete file"
git push
导航到项目的
Settings > Repository
并展开 Push Rules
。
设置您想要的规则,然后单击 Save Push Rules
以使更改生效
执行以下命令后仍然遇到错误:
git重置--hard@~
git rm 错误文件
git commit --修改“删除文件”
git 推送
我还能做些什么来解决这个问题吗?