我正在尝试清理git存储库。有一些已识别的大文件,其大小已减少并重新投入使用。问题是历史还有旧文件。所以我使用bfg清洁工作来修剪git repo。为此,我首先创建一个repo的镜像克隆,然后进行一些过滤以减小大小。
克隆命令: -
git clone --mirror ssh://git@url/repo.git
我成功地能够清理并减小克隆镜像的大小。现在我尝试将其推送到远程服务器。我用: -
git push
此操作失败并出现以下错误: -
Counting objects: 214329, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (80081/80081), done.
Writing objects: 100% (211535/211535), 666.00 MiB | 1.52 MiB/s, done.
Total 211535 (delta 116658), reused 206326 (delta 112960)
remote: You are attempting to update refs that are reserved for Stash's pull
request
remote: functionality. Stash manages these refs automatically, and they may
not be
remote: updated by users.
remote:
remote: Rejected refs:
remote: refs/pull-requests/190/from
remote: refs/pull-requests/247/from
remote: refs/pull-requests/247/merge
remote: refs/pull-requests/269/from
remote: refs/pull-requests/269/merge
remote: refs/pull-requests/270/from
To ssh://git@url/repo.git
! [remote rejected] integration -> integration (pre-receive hook declined)
! [remote rejected] integration_after_mavenrework -> integration_after_mavenrework (pre-receive hook declined)
! [remote rejected] master -> master (pre-receive hook declined)
我不确定为什么我无法推动。我对repo有写权限。
我被困住了,感谢任何帮助。
答案 0 :(得分:2)
问题在于:
git push
您必须使用旧版本的git< 2。
在旧版本中,只要在命令git之后使用git push/pull
没有任何分支名称,就可以将所有分支(已修改)分支到服务器。
在您的情况下,您必须克隆拉取请求,而不是尝试将它们推回到存储服务器。
Stash拒绝它并且不允许你推送那些引用。