# Safe to interrupt »git gc --auto«?

2 messages from 2014-10-29 to 2014-10-29. Participants: Thomas Schwinge, Jonathan Nieder.
Thread: https://gitlist.dev/t/37833

## Thomas Schwinge, 2014-10-29 15:06

Subject: Safe to interrupt »git gc --auto«?
Message-ID: <87fve6gbk3.fsf@kepler.schwinge.homeip.net>
URL: https://gitlist.dev/e/87fve6gbk3.fsf%40kepler.schwinge.homeip.net

```
Hi!

I couldn't find this answered in the documentation: if, instead of
exiting right away, a »git gc --auto« actually commences its housekeeping
tasks, is it safe to interrupt (C-c, SIGINT) the original git invocation
at this point, or might this cause any inconsistencies, data loss, or
failure to perform the task Git has originally been invoked for?  I
generally do find the auto-housekeeping useful, just sometimes it happens
at the "wrong" moment, and so I'd like to delay it until next time.


Grüße,
 Thomas

```

## Jonathan Nieder, 2014-10-29 20:50

Subject: Re: Safe to interrupt »git gc --auto«?
Message-ID: <20141029205051.GK5500@google.com>
URL: https://gitlist.dev/e/20141029205051.GK5500%40google.com
In-Reply-To: <87fve6gbk3.fsf@kepler.schwinge.homeip.net>

```
Thomas Schwinge wrote:

> I couldn't find this answered in the documentation: if, instead of
> exiting right away, a »git gc --auto« actually commences its housekeeping
> tasks, is it safe to interrupt (C-c, SIGINT) the original git invocation
> at this point, or might this cause any inconsistencies, data loss,
[...]

Heh.

If gc --auto happens in the middle of e.g. a rebase, then it's possible
that there were more commits that were supposed to happen later.  You'd
need to run 'git rebase --continue' after interrupting the gc in that
case.

Interruption should never cause data loss, and as much as possible
commands should finish their work before running gc --auto.  Please
let us know if some command is violating that.

Thanks,
Jonathan

```
