致命:无法取消'branch.master.remote'

Abh*_*yan 6 git bitbucket

我想删除git remote.我刚刚用命令删除了heroku远程url

$ git remote rm heroku
Run Code Online (Sandbox Code Playgroud)

但是当我尝试在远程用于bitbucket(原点)时使用它.它失败并出现错误

git remote rm origin        
fatal: could not unset 'branch.master.remote'
Run Code Online (Sandbox Code Playgroud)

列出远程时的位置

$ git remote -v
Run Code Online (Sandbox Code Playgroud)

明确提到

origin  git@bitbucket.org:username/myapp.git (fetch)
origin  git@bitbucket.org:username/myapp.git (push)
Run Code Online (Sandbox Code Playgroud)

的.git /配置

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[branch "master"]
[branch "static-pages"]
[remote "origin"]
    url = git@bitbucket.org:myUserName/mY_Hidden_App.git
    fetch = +refs/heads/*:refs/remotes/origin/*
Run Code Online (Sandbox Code Playgroud)

Von*_*onC 2

fatal: could not unset使用 Git 2.12.2 或更高版本(2017 年 3 月)不应再出现此错误消息 ( )

请参阅Ross Lagerwall ( )的提交 20690b2(2017 年 2 月 18 日)。(由Junio C Hamano 合并 -- --提交 3e5c639中,2017 年 2 月 27 日)rosslagerwall
gitster

git remote rm X”,当分支将远程X配置为其值时,如果未设置,则branch.*.remote尝试删除branch.*.remote和并失败。branch.*.merge

确保该[branch "master"]行已从本地配置中消失,并且昨天发布了最新的 Git 2.12.2,这种情况不会再次发生。