Git正在展示一个不存在的Heroku遥控器

时间:2016-11-26 19:08:50

标签: git macos heroku sourcetree

我正在关注this steps成功管理Heroku中的2个环境,以及如何在git中设置它。一切都运行正常,但现在我有一个问题,git显示我的遥控器的旧名称,并不能删除它。

在本教程之前,我只有两个遥控器herokustaging。但如上所述,建议的约定名称为productionheroku,因此我通过staging文件将远程.git/config重命名为staging。在此更改中,我必须遵循此说明:"Cannot update paths and switch to branch at the same time"因为重命名的> git branch -avv * develop [origin/develop] Merge branch 'dummy-fix' into develop dummy-fix changed full vs first_name master [origin/master] Merge branch 'develop' staging [staging/master] Merge branch 'develop' into staging remotes/heroku/master Merge branch 'develop' remotes/origin/develop Merge branch 'dummy-fix' into develop remotes/origin/master Merge branch 'develop' remotes/production/master Merge branch 'develop' remotes/staging/master Merge branch 'develop' into staging 遥控器不会显示任何分支。取得成功。

推送/拉取和部署现在使用Heroku envs非常好,但Sourcetree和git控制台显示旧的远程名称,我无法摆脱它:

remotes/heroku/master

远程> git remote rm heroku error: Could not remove config section 'remote.heroku' 不存在,但当我这样做时:

.git/config

这是我的[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true precomposeunicode = true [remote "origin"] url = https://my-user@the-repo-url-in-bitbucket.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master [branch "develop"] remote = origin merge = refs/heads/develop [remote "staging"] url = https://git.heroku.com/my-app-name-in-staging.git fetch = +refs/heads/*:refs/remotes/staging/* [remote "production"] url = https://git.heroku.com/my-app-name-in-production.git fetch = +refs/heads/*:refs/remotes/production/* [heroku] remote = staging [push] default = tracking [branch "staging"] remote = staging merge = refs/heads/master (显然不是真正的网址)

{{1}}

1 个答案:

答案 0 :(得分:1)

我一直在挖掘,似乎.git文件夹中有更多对config文件中的遥控器的引用。找到3个地方,我手动删除文件夹heroku,或配置文件中的参考,这似乎解决了它。现在我在终端和Sourcetree都没有看到幽灵远程。

enter image description here