2

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?)

Community
  • 1
  • 1
user2104419
  • 45
  • 1
  • 5
  • Does this answer your question? [Push to origin after reflog expire and gc prune](https://stackoverflow.com/questions/25907313/push-to-origin-after-reflog-expire-and-gc-prune) – tocic Oct 18 '22 at 05:11

0 Answers0