清理git存储库BFG Repo-Cleaner ---推送后repo大小仍然很大

时间:2018-05-15 06:34:06

标签: git github bfg-repo-cleaner

我正在尝试用BFG repo清理器清理我的git存储库。所以我做了: git clone --mirror https://github.com/FourierFlows/FourierFlows.jl.git 使用BFG,例如, java -jar bfg-1.13.0.jar --delete-files 'twodturb*.png' FourierFlows.jl.git 然后 cd FourierFlows.jl.git git reflog expire --expire=now --all && git gc --prune=now --aggressive

存储库现在要小得多(1.9MB而不是880MB)。但是当我再次推回并再次尝试git clone --mirror时,我仍然得到了我开始使用的存储库。

navid:FourierFlows.jl.git/ (master) $ git push
Counting objects: 4824, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (1639/1639), done.
Writing objects: 100% (4824/4824), 1.67 MiB | 1.07 MiB/s, done.
Total 4824 (delta 3061), reused 4824 (delta 3061)
remote: Resolving deltas: 100% (3061/3061), done.
To https://github.com/FourierFlows/FourierFlows.jl
 + f669d29...5146e5f ArchivedPhysics -> ArchivedPhysics (forced update)
 + 53da66f...6543491 BetteringTwoModes -> BetteringTwoModes (forced update)
 + 986cde0...a6562c4 BetteringTwoModesSystematically -> BetteringTwoModesSystematically (forced update)
 + 9b7e4e3...8db4ced BetteringTwoModes_StashedChanges -> BetteringTwoModes_StashedChanges (forced update)
 + 4adf9a4...bd7b62c GPUDomains -> GPUDomains (forced update)
 + 40e1318...bd7b4bf GPUTwoModes -> GPUTwoModes (forced update)
 + e2d551c...666d0f9 GPUTwoModes_APVTracerAdv -> GPUTwoModes_APVTracerAdv (forced update)
 + 23f1689...343ab15 TimestepperFormattingImprovements -> TimestepperFormattingImprovements (forced update)
 + 08bcc90...6a59cf1 TracerPatchEqn -> TracerPatchEqn (forced update)
 + 019c115...8b2b6c1 TwoModes -> TwoModes (forced update)
 + 740c9a1...c8c47dd UpdatesDocs -> UpdatesDocs (forced update)
 + 7456358...96c1686 VerticalModes -> VerticalModes (forced update)
 + 0b36327...a111d4e getETDcoeffsBigFLoat -> getETDcoeffsBigFLoat (forced update)
 + f90541a...de0c079 gh-pages -> gh-pages (forced update)
 + 8e1f439...f3e9ac0 makeJulia0p7compatible -> makeJulia0p7compatible (forced update)
 + 3211e48...8828ef5 master -> master (forced update)
 + 6ef5dfc...47c773c v0.0.1 -> v0.0.1 (forced update)
 + d6e2cf8...4e43e7f v0.0.2 -> v0.0.2 (forced update)
 + 3be73f7...dfc1060 v0.1.0 -> v0.1.0 (forced update)
 ! [remote rejected] refs/pull/10/head -> refs/pull/10/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/11/head -> refs/pull/11/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/12/head -> refs/pull/12/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/13/head -> refs/pull/13/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/14/head -> refs/pull/14/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/15/head -> refs/pull/15/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/17/head -> refs/pull/17/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/17/merge -> refs/pull/17/merge (deny updating a hidden ref)
 ! [remote rejected] refs/pull/19/head -> refs/pull/19/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/22/head -> refs/pull/22/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/23/head -> refs/pull/23/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/23/merge -> refs/pull/23/merge (deny updating a hidden ref)
 ! [remote rejected] refs/pull/24/head -> refs/pull/24/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/27/head -> refs/pull/27/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/3/head -> refs/pull/3/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/30/head -> refs/pull/30/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/32/head -> refs/pull/32/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/33/head -> refs/pull/33/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/34/head -> refs/pull/34/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/35/head -> refs/pull/35/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/36/head -> refs/pull/36/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/40/head -> refs/pull/40/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/41/head -> refs/pull/41/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/42/head -> refs/pull/42/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/43/head -> refs/pull/43/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/45/head -> refs/pull/45/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/46/head -> refs/pull/46/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/47/head -> refs/pull/47/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/48/head -> refs/pull/48/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/48/merge -> refs/pull/48/merge (deny updating a hidden ref)
 ! [remote rejected] refs/pull/49/head -> refs/pull/49/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/5/head -> refs/pull/5/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/50/head -> refs/pull/50/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/52/head -> refs/pull/52/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/53/head -> refs/pull/53/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/54/head -> refs/pull/54/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/56/head -> refs/pull/56/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/57/head -> refs/pull/57/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/58/head -> refs/pull/58/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/6/head -> refs/pull/6/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/8/head -> refs/pull/8/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/9/head -> refs/pull/9/head (deny updating a hidden ref)
error: failed to push some refs to 'https://github.com/FourierFlows/FourierFlows.jl'

但是,如果我将存储库推送到空的git repo,然后从那里克隆它,那确实很小。

navid:FourierFlows.jl.git/ (master) $ git remote set-url --push origin https://github.com/navidcy/FourierFlowsMirrored
navid:FourierFlows.jl.git/ (master) $ git push
Counting objects: 4824, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (1639/1639), done.
Writing objects: 100% (4824/4824), 1.67 MiB | 1.16 MiB/s, done.
Total 4824 (delta 3061), reused 4824 (delta 3061)
remote: Resolving deltas: 100% (3061/3061), done.
To https://github.com/navidcy/FourierFlowsMirrored
 * [new branch]      ArchivedPhysics -> ArchivedPhysics
 * [new branch]      BetteringTwoModes -> BetteringTwoModes
 * [new branch]      BetteringTwoModesSystematically -> BetteringTwoModesSystematically
 * [new branch]      BetteringTwoModes_StashedChanges -> BetteringTwoModes_StashedChanges
 * [new branch]      GPUDomains -> GPUDomains
 * [new branch]      GPUTwoModes -> GPUTwoModes
 * [new branch]      GPUTwoModes_APVTracerAdv -> GPUTwoModes_APVTracerAdv
 * [new branch]      TimestepperFormattingImprovements -> TimestepperFormattingImprovements
 * [new branch]      TracerPatchEqn -> TracerPatchEqn
 * [new branch]      TwoModes -> TwoModes
 * [new branch]      UpdatesDocs -> UpdatesDocs
 * [new branch]      VerticalModes -> VerticalModes
 * [new branch]      getETDcoeffsBigFLoat -> getETDcoeffsBigFLoat
 * [new branch]      gh-pages -> gh-pages
 * [new branch]      makeJulia0p7compatible -> makeJulia0p7compatible
 * [new branch]      master -> master
 * [new tag]         v0.0.1 -> v0.0.1
 * [new tag]         v0.0.2 -> v0.0.2
 * [new tag]         v0.1.0 -> v0.1.0
 ! [remote rejected] refs/pull/10/head -> refs/pull/10/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/11/head -> refs/pull/11/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/12/head -> refs/pull/12/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/13/head -> refs/pull/13/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/14/head -> refs/pull/14/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/15/head -> refs/pull/15/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/17/head -> refs/pull/17/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/17/merge -> refs/pull/17/merge (deny updating a hidden ref)
 ! [remote rejected] refs/pull/19/head -> refs/pull/19/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/22/head -> refs/pull/22/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/23/head -> refs/pull/23/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/23/merge -> refs/pull/23/merge (deny updating a hidden ref)
 ! [remote rejected] refs/pull/24/head -> refs/pull/24/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/27/head -> refs/pull/27/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/3/head -> refs/pull/3/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/30/head -> refs/pull/30/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/32/head -> refs/pull/32/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/33/head -> refs/pull/33/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/34/head -> refs/pull/34/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/35/head -> refs/pull/35/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/36/head -> refs/pull/36/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/40/head -> refs/pull/40/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/41/head -> refs/pull/41/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/42/head -> refs/pull/42/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/43/head -> refs/pull/43/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/45/head -> refs/pull/45/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/46/head -> refs/pull/46/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/47/head -> refs/pull/47/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/48/head -> refs/pull/48/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/48/merge -> refs/pull/48/merge (deny updating a hidden ref)
 ! [remote rejected] refs/pull/49/head -> refs/pull/49/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/5/head -> refs/pull/5/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/50/head -> refs/pull/50/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/52/head -> refs/pull/52/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/53/head -> refs/pull/53/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/54/head -> refs/pull/54/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/56/head -> refs/pull/56/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/57/head -> refs/pull/57/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/58/head -> refs/pull/58/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/6/head -> refs/pull/6/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/8/head -> refs/pull/8/head (deny updating a hidden ref)
 ! [remote rejected] refs/pull/9/head -> refs/pull/9/head (deny updating a hidden ref)
error: failed to push some refs to 'https://github.com/navidcy/FourierFlowsMirrored'

任何想法为什么会这样?显然我不知道git是否已经放弃了存储库中的文件...

1 个答案:

答案 0 :(得分:0)

这是清理GitHub repos的常见问题。问题的关键是:

! [remote rejected] refs/pull/10/head -> refs/pull/10/head (deny updating a hidden ref)

因此,在GitHub遥控器中没有清理已清理的Pull Requests中的所有历史记录。

这在how to remove sensitive data的GitHub文档(强调我的)中进行了简要讨论:

  

本文将告诉您如何使用GitHub存储库中任何分支或标记无法访问敏感数据的提交。但是,重要的是要注意,这些提交仍然可以在存储库的任何克隆或分支中访问,直接通过GitHub上的缓存视图中的SHA-1哈希,以及引用它们的任何拉取请求 。您无法对存储库的现有克隆或分支执行任何操作,但您可以通过联系GitHub支持永久删除所有存储库的缓存视图并在GitHub上提取请求。

因此,如果你想要你的Pull请求,以及他们引用的所有提交/历史记录,那么你在GitHub上的总回购大小可以缩小(除了已经缩小的默认克隆的大小),你需要联系GitHub支持。