From 737c5a9cde708d6995c765b7c2e95033edd0a896 Mon Sep 17 00:00:00 2001 From: Michael Schubert Date: Sat, 13 Jul 2013 11:36:24 +0200 Subject: fetch: make --prune configurable Without "git fetch --prune", remote-tracking branches for a branch the other side already has removed will stay forever. Some people want to always run "git fetch --prune". To accommodate users who want to either prune always or when fetching from a particular remote, add two new configuration variables "fetch.prune" and "remote..prune": - "fetch.prune" allows to enable prune for all fetch operations. - "remote..prune" allows to change the behaviour per remote. The latter will naturally override the former, and the --[no-]prune option from the command line will override the configured default. Since --prune is a potentially destructive operation (Git doesn't keep reflogs for deleted references yet), we don't want to prune without users consent, so this configuration will not be on by default. Helped-by: Junio C Hamano Signed-off-by: Michael Schubert Signed-off-by: Junio C Hamano --- Documentation/config.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Documentation/config.txt') diff --git a/Documentation/config.txt b/Documentation/config.txt index 6e53fc5074..e4ce7c46f9 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -1049,6 +1049,10 @@ fetch.unpackLimit:: especially on slow filesystems. If not set, the value of `transfer.unpackLimit` is used instead. +fetch.prune:: + If true, fetch will automatically behave as if the `--prune` + option was given on the command line. See also `remote..prune`. + format.attach:: Enable multipart/mixed attachments as the default for 'format-patch'. The value can also be a double quoted string @@ -1984,6 +1988,12 @@ remote..vcs:: Setting this to a value will cause Git to interact with the remote with the git-remote- helper. +remote..prune:: + When set to true, fetching from this remote by default will also + remove any remote-tracking branches which no longer exist on the + remote (as if the `--prune` option was give on the command line). + Overrides `fetch.prune` settings, if any. + remotes.:: The list of remotes which are fetched by "git remote update ". See linkgit:git-remote[1]. -- cgit v1.2.1