7

When I run a command like git gc, I get a message like this:

$ git fetch
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.

It seems like newer versions of Git run auto-packing in the background now, which is a nice feature! If I run git gc manually, I get this message:

$ git gc
fatal: gc is already running on machine 'machinename' pid 14009 (use --force if not)

This makes sense. However, I would quite like to be able to watch the progress of gc that is running the background somehow?

Obviously, I could run something like while ! git gc ; do sleep 1s ; done, but that doesn't give me nearly as much information as a pretty Git progress indicator could, and it runs auto-packing an additional time.

Flimm
  • 136,138
  • 45
  • 251
  • 267

1 Answers1

5

You can configure it to be non-background, then I belive it should report its progress:

 git config gc.autoDetach false
max630
  • 8,762
  • 3
  • 30
  • 55
  • 2
    This doesn't actually do anything to an already running background gc, it simply prevents any future command from doing the gc in the background. – Paul Wagland Jan 15 '18 at 21:24