Skip to main content

git 操作

在远程删除分支后,怎么同步本地也删除?

git remote prune origin

git fetch --prune

git remote prune [<options>] <name>

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(1) 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.