Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
git本地repo缓存已删除的远程/源分支_Git_Github_Repository_Branch_Git Branch - Fatal编程技术网

git本地repo缓存已删除的远程/源分支

git本地repo缓存已删除的远程/源分支,git,github,repository,branch,git-branch,Git,Github,Repository,Branch,Git Branch,我使用git clone 我在分行master 我执行git pull,然后执行git分支-a 分支列表包括remotes\origin\branch-x,而实际上已在GitHub上删除了branch-x 如何刷新本地回购分支缓存以正确反映GitHub上的状态 git远程修剪源 git remote prune origin <name> 删除下所有过时的远程跟踪分支。这些过时的分支已从引用的远程存储库中删除,但仍在“remotes/”中本地可用 使用--dry run选项,报告

我使用
git clone

我在分行
master

我执行
git pull
,然后执行
git分支-a

分支列表包括
remotes\origin\branch-x
,而实际上已在GitHub上删除了
branch-x

如何刷新本地回购分支缓存以正确反映GitHub上的状态

git远程修剪源
git remote prune origin <name>
删除
下所有过时的远程跟踪分支。这些过时的分支已从
引用的远程存储库中删除,但仍在“remotes/”中本地可用

使用--dry run选项,报告将修剪哪些分支,但不实际修剪它们

如果您不提供任何名称,它将删除所有分支。

使用
git fetch--prune
删除已删除的分支。此外,通过运行
git config remote..prune true