远程分支被删除后,本地同步
使用场景
- 远程库删除了原有分支 origin/dev0.1
- 本地仍然有远程分 remotes/origin/dev0.1 对应
- 希望同步本地库和远程分支的对应 (即清除本地上远程不存在的远程分支)
语法
git fetch -p
-p, —prune
After fetching, remove any remote-tracking references that no longer exist on the remote. Tags are not subject to pruning if they are fetched only because of the default tag auto-following or due to a —tags option. However, if tags are fetched due to an explicit refspec (either on the command line or in the remote configuration, for example if the remote was cloned with the —mirror option), then they are also subject to pruning.