Questions tagged [git-gc]

The `git gc` function is used to perform housekeeping in a Git repository, run automatically by certain other Git operations, or manually.

General information

This function performs a number of housekeeping operations on a Git repository, including compressing file revisions and removing unreachable objects.

There are three main modes of operation:

  • Automatic. Certain Git commands will run git gc --auto, which will attempt to determine whether clean-up is necessary, and perform it if so. Automatic housekeeping can be disabled by running git config gc.auto 0.

  • Manual. You can run git gc from the command line whenever you like. This is particularly important if you've disabled the automatic operation as above.

  • Aggressive. Running git gc --aggressive will perform a much slower and more thorough optimization. The Git man pages recommend doing this only "every few hundred changesets or so", since the effects are persistent.

See also the Git man page for git gc.

On Stack Overflow

The "git-gc" tag should be used for anything to do with this command: when to run it, how to run it, how to resolve problems with running it or caused by running it, and how to configure how it works.

61 questions
0
votes
1 answer

Git Extensions Push with default settings (*:refs/heads/*) messes up all branches

The issue This sounds like a GitExtensions bug, to which I couldn't find specific info. I believe the issue arises when you have a bare repository with more than 1 branch. If you then push, you'll get a warning that if you choose to ignore you'll…
cregox
  • 17,674
  • 15
  • 85
  • 116
1 2 3 4
5