以下git配置有什么区别

时间:2013-01-26 06:36:39

标签: git git-flow

.git / config 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 / config 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

2 个答案:

答案 0 :(得分:3)

如果您尝试使用[branch "develop"]从未定义git pull的仓库的开发分支中提取,则会收到错误,抱怨您未指定远程分支。 Git会建议您运行git branch --set-upstream develop origin/develop以创建该条目并正确跟踪远程分支。

答案 1 :(得分:3)

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

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