惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

I
InfoQ
Hugging Face - Blog
Hugging Face - Blog
月光博客
月光博客
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
SegmentFault 最新的问题
罗磊的独立博客
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
L
LINUX DO - 最新话题
T
Threatpost
Cisco Talos Blog
Cisco Talos Blog
The GitHub Blog
The GitHub Blog
V
V2EX
SecWiki News
SecWiki News
P
Privacy & Cybersecurity Law Blog
Forbes - Security
Forbes - Security
T
Troy Hunt's Blog
S
Security @ Cisco Blogs
Martin Fowler
Martin Fowler
Attack and Defense Labs
Attack and Defense Labs
A
Arctic Wolf
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Register - Security
The Register - Security
Blog — PlanetScale
Blog — PlanetScale
The Last Watchdog
The Last Watchdog
T
Tor Project blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cisco Blogs
P
Proofpoint News Feed
O
OpenAI News
Hacker News - Newest:
Hacker News - Newest: "LLM"
小众软件
小众软件
雷峰网
雷峰网
H
Heimdal Security Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Stack Overflow Blog
Stack Overflow Blog
Engineering at Meta
Engineering at Meta
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
C
Cyber Attacks, Cyber Crime and Cyber Security
Webroot Blog
Webroot Blog
C
Check Point Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
W
WeLiveSecurity
T
Threat Research - Cisco Blogs
人人都是产品经理
人人都是产品经理
Hacker News: Ask HN
Hacker News: Ask HN
The Hacker News
The Hacker News
V
Vulnerabilities – Threatpost
Microsoft Security Blog
Microsoft Security Blog

博客园 - 灰色飘零

Hilt 依赖注入实战指南 Android R8适配全流程详解 AI Coding逐步引导式开发,从零到一生成完整技术方案 AI 时代的新项目技术最佳选型 如何建立人类与 AI 的协作习惯 【实战】用 AI 吃透 Git Commit:从代码修改到原理拆解 + 学习规划 端侧大模型实践 - 生成预测模型&模型轻量化&端侧部署 端侧大模型实践-ESC上实现大模型轻量化功能 端侧大模型实践 - Hadoop + Spark 配置方案 端侧大模型实践 - 端侧大模型极简版Demo版落地概述 Agent 会重构数字服务入口与分发逻辑,但不会彻底消灭 APP 解构 AICoding 底层逻辑:人的能力定义 AI 边界 告别AI概念混乱!一次性讲透 Agent Skills、Rules、Prompt、MCP AI编程的实践场景与未来可能:一场开发范式的演进 移动端 SDK 开发经验总结及梳理 Android WebView不显示Mixed Content的问题解决方案 Android SDK 组件化 AAR 打包集成 【工信部】App违法违规收集使用个人信息行为认定方法 Java 安全密码学 Android使用ContentProvider初始化SDK库方案总结
Git 远程删除分支后,本地 git branch -a 依然能看到的解决办法
灰色飘零 · 2021-06-22 · via 博客园 - 灰色飘零

使用 git branch -a 命令可以查、看所有本地分支和远程分支(git branch -r 可以只查看远程分支)。发现很多在远程仓库已经删除的分支在本地依然可以看到。

$ git branch -a
  movtop
  task_develop
* weibo
  remotes/origin/HEAD -> origin/task_develop
  remotes/origin/develop
  remotes/origin/fix_composer_repositories_type
  remotes/origin/join_weixin_module
  remotes/origin/master
  remotes/origin/mining-backup
  remotes/origin/movtop
  remotes/origin/right
  remotes/origin/schedule_dev
  remotes/origin/stuff_web_fix
  remotes/origin/task_develop
  remotes/origin/task_idea
  remotes/origin/task_temp
  remotes/origin/task_yqj
  remotes/origin/weibo
  remotes/origin/weixin_temp

使用命令 git remote show origin,可以查看remote地址,远程分支,还有本地分支与之相对应关系等信息。

此时我们可以看到那些远程仓库已经不存在的分支,根据提示,使用 git remote prune origin 命令:

$ git remote prune origin
 
Pruning origin
URL: https://xxx@gitlab.com/xxx/xxx.git
 * [pruned] origin/develop
 * [pruned] origin/fix_composer_repositories_type
 * [pruned] origin/join_weixin_module
 * [pruned] origin/movtop
 * [pruned] origin/right
 * [pruned] origin/schedule_dev
 * [pruned] origin/stuff_web_fix
 * [pruned] origin/task_temp
 * [pruned] origin/weibo

这样就删除了那些远程仓库不存在的分支。