如果我这样做
git remote -v
我得到了
origin https://..../foo.git (fetch)
origin https://..../foo.git (push)
upstream
这最后一条上游线阻止我添加一个我想要合并的真实上游。
我的配置文件如下所示:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
url = https://..../foo.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
当我做的时候
git fetch upstream
我收到此错误:
fatal: 'upstream' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我怎样才能摆脱那个上游?
答案 0 :(得分:1)
Git有几个范围,其中设置了配置:system
($(prefix)/etc/gitconfig
),global
(~/.gitconfig
)和local
(.git/config
当前的存储库)。
由于upstream
范围内没有关于local
的内容,因此您必须检查system
和global
范围。它可能只是对相关文件的写访问权限。