1

如果我做

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.

我怎样才能摆脱上游?

4

1 回答 1

1

Git 有几个设置 config 的范围:( system) $(prefix)/etc/gitconfigglobal( ~/.gitconfig) 和local(.git/config的当前存储库)。

upstream由于您的范围内没有任何内容local,因此您必须检查systemandglobal范围。它可能只是对关联文件的写访问权限。

于 2013-06-19T11:28:35.477 回答