Git Sync Local Branches With Remote
The git fetch --prune command is used in the Git version control system to update your local repository with changes from a remote repository while also removing any references to remote branches that have been deleted on the remote.
git fetch --prune
I have the following local branches:
While remote branches are:
Now, the magic moment: When you use git fetch --prune:
Observe how local branches are now synchronized with the remote:
That's the secret recipe—keeping things neat and tidy in your local repo 😉.