3

.git/配置 1

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = ssh://johndoe@example.com//repositories/plugins/myproject.git
[branch "master"]
    remote = origin
    merge = refs/heads/master

.git/配置 2

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = ssh://johndoe@example.com//repositories/plugins/myproject.git
[branch "master"]
    remote = origin
    merge = refs/heads/master
[branch "develop"]
    remote = origin
    merge = refs/heads/develop]

但是,在两个存储库中,当我输入 时branch -a,都返回

git branch -a
* develop
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/develop
  remotes/origin/master
4

2 回答 2

3

develop在第一个中,您没有分支跟踪远程存储库上的分支。

git branch -avv查看每个存储库上运行的差异。这将显示所有分支(本地和远程),每个提交的内容以及每个本地分支跟踪哪些远程分支(如果有)。

于 2013-01-26T20:21:01.077 回答
3

如果您尝试从未定义[branch "develop"]using的 repo 的开发分支中提取git pull,您将收到一条错误消息,提示您未指定远程分支。Git 会建议您运行git branch --set-upstream develop origin/develop以创建该条目并正确跟踪远程分支。

于 2013-01-26T07:18:12.843 回答