Skip to content

Instantly share code, notes, and snippets.

@koseki
Last active January 27, 2017 04:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koseki/b67f960c842313f8330c to your computer and use it in GitHub Desktop.
Save koseki/b67f960c842313f8330c to your computer and use it in GitHub Desktop.
Git GC の各種設定について

git gc の各種設定について

git gc 関連の設定のメモ。

git help config で確認できる。見出しの値はデフォルト。

gc.auto 6700

When there are approximately more than this many loose objects in the repository, git gc --auto will pack them.

パックされてないオブジェクトが約 6700 個を越えると、git gc --auto がそれらをパックする。

Some Porcelain commands use this command to perform a light-weight garbage collection from time to time.

Porcelain (一般ユーザ向け) コマンドのいくつかは、軽量なガベージコレクションのために git gc --auto を裏で実行する。

The default value is 6700. Setting this to 0 disables it.

gc.autopacklimit 50

When there are more than this many packs that are not marked with *.keep file in the repository, git gc --auto consolidates them into one larger pack.

pack ファイルが 50 個を越えると、git gc --auto 時に 1つの pack にまとめ直される。*.keep ファイルで保持し続けられる。

The default value is 50. Setting this to 0 disables it.

gc.pruneExpire 2 weeks ago

When git gc is run, it will call prune --expire 2.weeks.ago.

git gc 実行時に、prune --expire 2.weeks.ago が呼ばれる。2週間以上前の、到達不能なオブジェクトが削除される。

Override the grace period with this config variable.

The value "now" may be used to disable this grace period and always prune unreachable objects immediately.

now を指定すると到達不能なオブジェクトがすぐ削除される。

gc.reflogexpire 90 days

git reflog expire removes reflog entries older than this time;

90 日以上前の reflog は git reflog expire 時に削除される。

defaults to 90 days.

With "<pattern>" (e.g. "refs/stash") in the middle the setting applies only to the refs that match the <pattern>.

gc.<pattern>.reflogexpire のような設定で、reflog 毎の期限を設定できる。

gc.reflogExpireUnreachable 30 days

git reflog expire removes reflog entries older than this time and are not reachable from the current tip;

git reflog expire 時に、現在の(リファレンスが指す?) 先端(tip) から到達できない reflog で 30 日以上前のものを削除する。

defaults to 30 days.

With "<pattern>" (e.g. "refs/stash") in the middle, the setting applies only to the refs that match the <pattern>.

gc.reflogexpire と同様に、パターン指定できる。

gc.rerereresolved 60 days

Records of conflicted merge you resolved earlier are kept for this many days when git rerere gc is run.

git rerere gc 実行時に、60 日以上前に解消したコンフリクトのマージの記録が削除される。

The default is 60 days. See git-rerere(1).

gc.rerereunresolved 15 days

Records of conflicted merge you have not resolved are kept for this many days when git rerere gc is run.

git rerere gc 実行時に、15 日以上前の解消しなかったコンフリクトのマージの記録が削除される。

The default is 15 days. See git-rerere(1).

gc.aggressiveWindow 250

The window size parameter used in the delta compression algorithm used by git gc --aggressive. This defaults to 250.

git gc --aggressive 時に使う差分圧縮のパラメータ。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment