【问题标题】:Git: dealing with remote branches from a removed remoteGit:处理来自已删除远程的远程分支
【发布时间】:2013-03-25 16:25:05
【问题描述】:
  1. git branch -a 显示remotes/team/masterremotes/team/my-branch

  2. git remote rm team"error: Could not remove config section 'remote.team'"(因为我用文本编辑器编辑了配置文件)。

既然team 远程消失了,我该如何删除这些(本地)远程分支?

【问题讨论】:

标签: git git-remote


【解决方案1】:

删除远程跟踪分支:

git branch -rd team/master 

-r 表示远程。所以-rd的意思是删除远程跟踪分支。

自动远程远程跟踪没有上游分支的任何远程分支:

git remote prune

【讨论】:

  • git remote prune team 失败,因为找不到 teamgit branch -rd team/master 效果很好。谢谢!
  • git branch -rd team/HEAD 不起作用。知道如何摆脱那个吗?
  • 找到answergit remote set-head team -d
猜你喜欢
  • 2021-04-15
  • 1970-01-01
  • 1970-01-01
  • 2015-09-26
  • 2013-01-07
  • 1970-01-01
  • 2016-10-20
  • 2016-02-01
  • 2021-08-22
相关资源
最近更新 更多