Sync all branches with git

I think you want to:

git fetch --all -Pp

where:
git fetch Download objects and refs from another (remote) repository

--all fetch all remotes.

-P remove any remote-tracking references that no longer exist on the remote.

-p remove any local tags that no longer exist on the remote.

for more use git fetch --help

We have a similar command that only perform a prune not fetching remote data:

git remote prune origin

We can also set the git client to do the remote prune every time we fetch data:

git config --global fetch.prune true

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)