5

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
  • 115,689
  • 38
  • 227
  • 240

1 Answers1

4

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

 git config gc.autoDetach false
max630
  • 7,979
  • 3
  • 27
  • 52
  • 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