gpt4 book ai didi

git - 致命的 : could not unset 'branch.master.remote'

转载 作者:太空狗 更新时间:2023-10-29 13:15:09 25 4
gpt4 key购买 nike

我正在尝试删除 git remote。我刚刚使用命令删除了 heroku 远程 url

$ git remote rm heroku

但是当我尝试将它远程用于 bitbucket(origin) 时。它因错误而失败

git remote rm origin        
fatal: could not unset 'branch.master.remote'

列出远程时在哪里

$ git remote -v

明确提到

origin  git@bitbucket.org:username/myapp.git (fetch)
origin git@bitbucket.org:username/myapp.git (push)

.git/config

[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/*

最佳答案

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

参见 commit 20690b2 (2017 年 2 月 18 日)Ross Lagerwall (rosslagerwall) .
(由 Junio C Hamano -- gitster -- merge 于 commit 3e5c639 ,2017 年 2 月 27 日)

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

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

关于git - 致命的 : could not unset 'branch.master.remote' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41567402/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com