git 本地回购缓存已删除 remotes/origin 个分支
git local repo caching deleted remotes/origin branches
我使用 git clone
创建了一个本地存储库
我在分支机构master
我执行git pull
然后git branch -a
分支列表包括 remotes\origin\branch-x
,而实际上 branch-x
已在 GitHub 上删除。
如何刷新我的本地回购分支缓存以正确反映 GitHub 上的状态?
git remote prune origin <name>
Deletes all stale remote-tracking branches under <name>
. These stale branches have already been removed from the remote repository referenced by <name>
, but are still locally available in "remotes/".
With --dry-run option, report what branches will be pruned, but do not actually prune them.
如果你不给任何名字,它会修剪所有的分支。
使用git fetch --prune
修剪删除的分支。此外,您可以通过 运行 git config remote.<remote name>.prune true
将其设置为 pull
或 fetch
的默认值
我使用 git clone
我在分支机构master
我执行git pull
然后git branch -a
分支列表包括 remotes\origin\branch-x
,而实际上 branch-x
已在 GitHub 上删除。
如何刷新我的本地回购分支缓存以正确反映 GitHub 上的状态?
git remote prune origin <name>
Deletes all stale remote-tracking branches under
<name>
. These stale branches have already been removed from the remote repository referenced by<name>
, but are still locally available in "remotes/".With --dry-run option, report what branches will be pruned, but do not actually prune them.
如果你不给任何名字,它会修剪所有的分支。
使用git fetch --prune
修剪删除的分支。此外,您可以通过 运行 git config remote.<remote name>.prune true
pull
或 fetch
的默认值