Scope of gc prune and git reflog expire, and related config

痴心易碎 提交于 2019-12-08 02:58:16

问题


We are using throwaway integration branches which are pushed, and then later deleted and recreated. However the discarded branches are leaving dangling commits and trees which I can view with this command: git fsck --unreachable --no-reflogs

I could clean them up with

git reflog expire --expire-unreachable=now --all
git gc --prune=now

or something similar, but I want to understand the scope of these commands and related configuration first.

So the specific questions:

  • So that new clones are lean, how can I gc prune and clear the reflogs, not just locally but also on our remote repository hosted on GitHub?
  • Can I set the related git config items (e.g. gc.pruneexpire, gc.reflogexpire, gc.reflogexpireunreachable) for the GitHub hosted repository?

P.S.: See here for useful context: Listing and deleting Git commits that are under no branch (dangling?)

来源:https://stackoverflow.com/questions/16472743/scope-of-gc-prune-and-git-reflog-expire-and-related-config

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!