Commit 8a40f8b
maintenance: add prune-remote-refs task
Remote-tracking refs can accumulate in local repositories even as branches
are deleted on remotes, impacting git performance negatively. Existing
alternatives to keep refs pruned have a few issues:
1. Running `git fetch` with either `--prune` or `fetch.prune=true`
set, with the default refspec to copy all their branches into
our remote-tracking branches, will prune stale refs, but also
pulls in new branches from remote. That is undesirable if the
user wants to only work with a selected few remote branches.
2. `git remote prune` cleans up refs without adding to the
existing list but requires periodic user intervention.
Add a new maintenance task 'prune-remote-refs' that runs 'git remote
prune' for each configured remote daily. Leave the task disabled by
default, as it may be unexpected to see their remote-tracking
branches to disappear while they are not watching for unsuspecting
users.
Signed-off-by: Shubham Kanodia <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 76cf4f6 commit 8a40f8b
File tree
3 files changed
+96
-0
lines changed- Documentation
- builtin
- t
3 files changed
+96
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
161 | 181 | | |
162 | 182 | | |
163 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
916 | 917 | | |
917 | 918 | | |
918 | 919 | | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
919 | 944 | | |
920 | 945 | | |
921 | 946 | | |
| |||
1378 | 1403 | | |
1379 | 1404 | | |
1380 | 1405 | | |
| 1406 | + | |
1381 | 1407 | | |
1382 | 1408 | | |
1383 | 1409 | | |
| |||
1414 | 1440 | | |
1415 | 1441 | | |
1416 | 1442 | | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
1417 | 1447 | | |
1418 | 1448 | | |
1419 | 1449 | | |
| |||
1508 | 1538 | | |
1509 | 1539 | | |
1510 | 1540 | | |
| 1541 | + | |
| 1542 | + | |
1511 | 1543 | | |
1512 | 1544 | | |
1513 | 1545 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
450 | 494 | | |
451 | 495 | | |
452 | 496 | | |
| |||
0 commit comments