I've accidentally pruned some remote branches and I don't really know what the consequence of this is (I clicked the "Prune remote branches" button in Git Extensions, thinking it would delete a remote branch).
The official documentation says "git-prune - Prune all unreachable objects from the object database ". I don't really understand what this means. I'm guessing this might have removed merged branches but I'm not really sure.
With --prune , the update process simply removes any remote-tracking names that exist in your repository, but no longer correspond to a branch name in the repository at remote .
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.
Delete remote tracking branch in GitThe prune option removes any remote tracking branch in your local repository that points to a remote branch that has been deleted on the server.
"Prune remote branches" in Git Extensions executes git remote prune
command, which removes your local remote tracking branches where the branch no longer exists on the remote.
See here: https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-empruneem
Deletes stale references associated with <name>. By default, stale remote-tracking branches under <name> are deleted, but depending on global configuration and the configuration of the remote we might even prune local tags that haven’t been pushed there. Equivalent to
git fetch --prune <name>
, except that no new references will be fetched.See the PRUNING section of git-fetch for what it’ll prune depending on various configuration.
With
--dry-run
option, report what branches would be pruned, but do not actually prune them.
This just garbage collects your branches.
Thats means, if an object (a commit) cannot be reached in any of your branch's ancestors, it will be removed for the git database, and as such couldn't be reach anymore.
This just cleans up a little the git repository and make it lighter.
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