Synchronizing Git Remote and Local Branches

Sync branch

When you work locally after cloning Git source code, remote branches and local remote-tracking branches may sometimes become out of sync. A common example is when a branch deleted on the remote still remains locally.

In that case, you can synchronize with the following command.

git remote prune origin
% git remote prune origin
Pruning origin
URL: https://git.devkuma.com/devkuma/devkuma-hugo-blog.git
 * [pruned] origin/feature/ISSUE-10-fix-code
 * [pruned] origin/feature/ISSUE-13-refactoring
 * [pruned] origin/feature/ISSUE-26-add-page