上游的Git设置不起作用

时间:2013-10-04 18:14:25

标签: git

我正在尝试将我的git repo设置为在我的分支上设置上游,但它不起作用。

我的.git / config看起来像:

[core]
    repositoryformatversion = 0
    filemode = false
    logallrefupdates = true
[remote "origin"]
    url = ssh://cjdawson@new.initialreality.com:22/git-repos/webmessage/server/java/webmessage-server.git
    fetch = +refs/heads/*:refs/remotes/origin/*
    fetch = refs/notes/*:refs/notes/*
    push = HEAD:refs/for/master
    pushurl = ssh://cjdawson@new.initialreality.com:22/git-repos/webmessage/server/java/webmessage-server.git
[branch "master"]
    remote = origin
    merge = refs/heads/master
[branch "develop"]
    remote = origin
    merge = refs/heads/develop
[gerrit]
    createchangeid = true
[push]
    default = upstream

当我跑git remote show origin时,我得到:

* remote origin
  Fetch URL: ssh://cjdawson@new.initialreality.com:22/git-repos/webmessage/server/java/webmessage-server.git
  Push  URL: ssh://cjdawson@new.initialreality.com:22/git-repos/webmessage/server/java/webmessage-server.git
  HEAD branch: master
  Remote branches:
    develop tracked
    master  tracked
  Local branches configured for 'git pull':
    develop merges with remote develop
    master  merges with remote master
  Local ref configured for 'git push':
    HEAD pushes to refs/for/master (up to date)

如果我运行git push origin developgit branch -u origin/develop,则show origin的输出不会更改。我的配置有问题吗?

2 个答案:

答案 0 :(得分:0)

git remote show的输出具有误导性,但您已经配置了上游分支,您可以在“为git pull'配置的本地分支中看到它们。”

我个人使用git branch -vv来查看每个分支的上游跟踪分支。

答案 1 :(得分:0)

原来我的远程存储库中有文件(不确定它们是如何到达那里的)并且它们正在创建问题。删除后,事情似乎现在有效。