0

我正在尝试将我的 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 developor git branch -u origin/develop,则 show origin 的输出不会改变。我的配置有问题吗?

4

2 回答 2

0

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

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

于 2013-10-04T18:18:26.103 回答
0

事实证明,我的远程存储库中有文件(不确定它们是如何到达那里的)并且它们正在制造问题。删除它们后,现在似乎一切正常。

于 2013-11-14T19:15:58.660 回答