You might be needing a cleanup
(您可能需要清理)
git gc --prune=now
or you might be needing a prune
(或者你可能需要修剪)
git remote prune public
prune
(修剪)
Deletes all stale tracking branches under <name>.
(删除<name>下的所有陈旧跟踪分支。)
These stale branches have already been removed from the remote repository referenced by <name>, but are still locally available in "remotes/<name>". (这些陈旧的分支已从<name>引用的远程存储库中删除,但仍在“remotes / <name>”中本地可用。)
With --dry-run option, report what branches will be pruned, but do no actually prune them.
(使用--dry-run选项,报告将修剪哪些分支,但不实际修剪它们。)
However, it appears these should have been cleaned up earlier with
(但是,看起来这些应该早点用)
git remote rm public
rm
(R M)
Remove the remote named <name>.
(删除名为<name>的远程。)
All remote tracking branches and configuration settings for the remote are removed. (将删除远程的所有远程跟踪分支和配置设置。)
So it might be you hand-edited your config file and this did not occur, or you have privilege problems.
(因此,您可能手动编辑了配置文件,但这没有发生,或者您有权限问题。)
Maybe run that again and see what happens.
(也许再次运行,看看会发生什么。)
Advice Context (建议背景)
If you take a look in the revision logs , you'll note I suggested more "correct" techniques, which for whatever reason didn't want to work on their repository.
(如果您查看修订日志 ,您会注意到我提出了更多“正确”的技术,这些技术无论出于什么原因都不想在其存储库中运行。)
I suspected the OP had done something that left their tree in an inconsistent state that caused it to behave a bit strangely, and git gc
was required to fix up the left behind cruft.
(我怀疑OP已经做了一些让他们的树处于不一致状态的东西,导致它表现得有些奇怪,并且需要git gc
来修复左后方残骸。)
Usually git branch -rd origin/badbranch
is sufficient for nuking a local tracking branch , or git push origin :badbranch
for nuking a remote branch, and usually you will never need to call git gc
(通常 git branch -rd origin/badbranch
足以用于本地跟踪分支,或者git push origin :badbranch
用于核心远程分支, 通常你永远不需要调用git gc
)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…