Does Git have anything akin to git remote prune --all
to automatically prune all remotes in a repository? Is there anything more built-in (or elegant) than this bash loop I've used?
for REMOTE in `git remote`; do git remote prune $REMOTE; done
Prune/Cleanup the local references to remote branch The command git remote prune origin --dry-run lists branches that can be deleted/pruned on your local. An option --dry-run is needed. Now go ahead and actually prune/cleanup the local references by running the command git remote prune origin .
In order to clean up remote-tracking branches while fetching, use the “git fetch” command with the “–prune” option. Alternatively, you can simply use the “-p” shortcut instead of typing “prune” every time.
remove the file from your project's current file-tree. remove the file from repository history — rewriting Git history, deleting the file from all commits containing it. remove all reflog history that refers to the old commit history. repack the repository, garbage-collecting the now-unused data using git gc.
It turns out Git does have this functionality, and it can be accomplished one of two ways:
git remote update --prune
(ht. morty)git fetch --prune --all
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With